I see YYYYYYYY in serial monitor.
But I never see XXXXXXX.
void setup() must be called otherwise I would never see YYYYYYYY.
But why is XXXXXXX never output????
Have you checked that !Serial actually pauses, add a small delay before the XXX. Note the timestamp, subtract the delay and that is how long the Serial port took to initialize.