Having successfully passed his background check, Tudor is finally on his way to Google! Little does he know that Carol is attempting to surprise him by arriving there first.
Carol is currently in Canada and needs to sneak over to Google. This will require taking several flights.
Because Carol is flying Air Canada, she is sure that she will be accepted at all intermediate airports and eventually be able to arrive at Google. However, a recent law called The Last Endeavor recently passed, which allows Wicked Agents to Realistically Terminate Every flight that goes from one airport to another. This will cause mass load externally.
Carol is prepared for this contingency - if the TLE forces the WAs to RTE a given flight, is it still possible for her to fly AC to Google?
The first line of the input contains two space-separated integers, and .
Each of the next lines contains two space-separated integers, and , indicating that there are one-way flights from airport to .
You may assume that any given tuple appears at most once.
Carol starts at airport and wishes to get to airport .
On the th line, given that the th flight is impossible to take but all other flights are permissible,
YES if it is still possible for Carol to get to airport from airport . Print
3 3 1 2 2 1 2 3
NO YES NO