I am not good with formulas in Excel and I was hoping that someone might be able to help me. I'll try to show below what I would like to do.

0 1 2 3 4 5
0 2 4 5 X
1 3

So the first row has 5 numbers, and the second row has 4 numbers that repeated from the previous row, therefore is an "X" next to the numbers. But in the third row, there are two numbers, but they're not repeats from the previous row, therefore there is no "X" next to the numbers.
I need a formula that can help me do this, is it possible? Basically each row is looking for ANY repeats from the previous row, and if there is, an X automatically appears in the cell next to the numbers.

One more thing, is it possible to insert a check mark instead of "X"

I'm very sorry if I'm not very clear at what I want done. I'm not good with excel or math language lol.
Thanks ahead of time for any help that I can get.