You can Leave Y anytime you want even in Working hours just go from Them if you get the Offer from Z.. :p