Past tense in Mandarin
When you write a sentence in chinese where you indicate with an adverb the time of the action for example:
昨天我吃了炒饭
上星期我去了北京
is it necessary to add the particle 了 to indicate that the action was completed or can you omit it and just write
昨天我吃炒饭
上星期去北京
note: I want to know which one of the past two examples are correct the first or the second and why