One Number Hint

No attempts yetTime limit1sMemory limit256 MB

Problem

A and B want to get into a locked research laboratory. The entrance runs a security system that asks one question. The question is written as an integer qq with 1qN1 \le q \le N, and it must be answered with either yes or no. A correct answer opens the door, and a wrong answer sets off the alarm.

Both of them know that qq is always either xx or yy, where xyx \ne y, the correct answer to xx is yes, and the correct answer to yy is no.

While they were planning, neither could recall the actual values of xx and yy. So B walks up to the entrance alone and A waits far away. The moment the question appears, A remembers xx and yy. From that distance A cannot explain anything to B. A can only shout one integer hh. Everything B needs has to fit into that single hh.

Write a program that plays both parts. In the first run it reads NN, xx, yy and prints the number hh that A shouts. In the second run it reads NN, qq, hh and prints the answer B should give.

The two runs are judged separately, so the rule that turns (x,y)(x, y) into hh and the rule that turns (q,h)(q, h) into an answer are both fixed here.

The subset table. Take every 6-element subset of {1,2,,12}\{1, 2, \dots, 12\}, write each subset as its elements in increasing order, and sort those sequences lexicographically. There are 924 such subsets. Let S(v)S(v) be the vv-th subset in this order, counting from 1. The first four are S(1)={1,2,3,4,5,6}S(1) = \{1,2,3,4,5,6\}, S(2)={1,2,3,4,5,7}S(2) = \{1,2,3,4,5,7\}, S(3)={1,2,3,4,5,8}S(3) = \{1,2,3,4,5,8\} and S(4)={1,2,3,4,5,9}S(4) = \{1,2,3,4,5,9\}, and the last one is S(924)={7,8,9,10,11,12}S(924) = \{7,8,9,10,11,12\}.

The number A shouts. For a pair (x,y)(x, y), hh is the smallest number that belongs to S(x)S(x) and not to S(y)S(y). Two different subsets of the same size never contain one another, so such a number always exists.

The answer B gives. For a pair (q,h)(q, h), the answer is yes if hS(q)h \in S(q), and no otherwise.

Input

The first line contains a single integer, either 1 or 2.

If it is 1, the program plays A. The second line contains NN and TT. The ii-th of the next TT lines contains xx and yy (1x,yN1 \le x, y \le N, xyx \ne y).

If it is 2, the program plays B. The second line contains NN and TT. The ii-th of the next TT lines contains qq and hh (1qN1 \le q \le N, 1h121 \le h \le 12).

Output

If the program plays A, print TT lines. The ii-th line holds the number hh for test case ii, computed by the rule above.

If the program plays B, print TT lines. The ii-th line holds the answer for test case ii, computed by the rule above, written as yes or no.

Constraints

In every test case 1N9201 \le N \le 920 and 1T100001 \le T \le 10\,000.