Can I submit a paper to two or more journals at the same time?

No, not the same paper in two journals at the same time.

Either submit to X again or submit to Y.


No.

You must not submit to more than one journal at a time. Most journals explicitly forbid this in their policies. The reason is that people agree to spend a significant amount of time reviewing your paper essentially as a favour and their effort is completely wasted if you then say, "Thanks but my paper was accepted somewhere else."

You must decide now whether to resubmit to the same journal or to try for a less prestigious one. Since you're asking the question, I assume you're a student: discuss this with your advisor! That's what they're there for.