the first company can't do anything to you...

...it might be a bit unethical, to work for Y from X's view, but that is it