I went to the final round of interview of two companies X and Y. I like company Y much more than X. Company X gave me an offer and I accepted. I have started the hiring process with them. I informed Y about the offer. Then Y rejected me, but told me that I was their 2nd choice when I asked them for feedback. Y asked me if I would be open to joining them if things don't work out with the 1st choice.
I'd like to take up company Y's "offer", but I don't want to sound desperate. But, I am not sure if I should even consider Y's "offer" in the first place, especially since I am their backup. Another question is what is the impact of leaving company X before or shortly after my start date? Is it okay to leave so soon like this?