There are $N$ integer variables $a_1, ..., a_N$. All the initial values are unspecified. You have to process $M$ events in order, each of which is an observation event, a change event or an inquiry event.
One kind of an observation event has the format,
1 $x$ $y$
which represents that it is observed that $a_x$ and $a_y$ are equal. In other words, after this event it is guaranteed that these two variables have the same value unless there is a change event for either variable.
The other kind of an observation event has the format,
2 $x$ $y$
which represents that it is observed that $a_x$ and $a_y$ are not equal.
A change event has the format,
3 $x$
which represents that the value of $a_x$ changes to a different integer.
Finally, an inquiry event has the format,
4 $x$ $y$
which asks whether $a_x$ and $a_y$ are equal. If it can be proven from all the past events that $a_x$ and $a_y$ are equal, you have to print Yes. Similarly, if it can be proven that $a_x$ and $a_y$ are not equal, you have to print No. If neither can be proven, you have to print Unknown.
The input consists of a single test case of the following format, where all values in the input are integers.
$N$ $M$ $event_1$ $\vdots$ $event_M$
The integer $N$ is the number of variables ($1 \leq N \leq 10^6$). The integer $M$ is the number of events ($1 \leq M \leq 500,000$). $M$ events are given in chronological order. The format of each event is explained above. In an observation event or an inquiry event, it is guaranteed that $1 \leq x < y \leq N$. In a change event it is guaranteed that $1 \leq x \leq N$.
At any point, it is guaranteed that there is at least one assignment to all $N$ variables that contradicts none of the given information.
For each inquiry event, print Yes, No or Unknown followed by a newline.
4 11 1 1 2 4 1 2 2 3 4 4 3 4 4 1 3 1 1 3 4 1 3 4 1 4 3 1 4 1 3 4 1 4
Yes No Unknown Yes No No Unknown