Online video streaming services have pushed DVD rental shops out of sight one by one. The owners who are left bet a thin last hope on a popular series and stock N discs of it. The discs are numbered 0 to N-1.
Juyeon bought the series too and had a shelf built to order for it. The slots on that shelf are numbered 0 to N-1 as well. Juyeon is a very tidy person, so disc i goes into slot i.
Minho, a devoted fan of the series, heard that it had arrived and came to the shop. A series loses its pull unless you watch it in order, so Minho wants to borrow discs L to R. Trusting how tidy Juyeon is, Minho never checked the numbers on the discs and simply carried whatever sat in slots L to R over to the counter.
Minho overlooked one thing. The shop has a nuisance customer, Jinil, who swaps the disc in slot A with the disc in slot B. Because of that thoughtless prank, customers who trust Juyeon and skip checking the numbers keep walking out with the wrong discs. With the shop about to lose money over these pointless attacks, Juyeon threw Jinil out on sight, but that was not enough to stop someone who drops in at any hour.
Minho felt bad for Juyeon and decided to write a program. The skill did not keep up with the enthusiasm, so the program does only two things.
To keep the problem simple, assume a customer who borrows discs watches them at once and returns them right away. Returned discs go back exactly where they were. If they sat in the order 4, 3, 2, they go back in the order 4, 3, 2.
The first line contains the number of test cases T. (T is a natural number with T ≤ 20)
The first line of each test case contains an integer N, the number of discs, and an integer K, the number of events at the shop. (1 ≤ N ≤ 100,000, 1 ≤ K ≤ 50,000)
Each of the following K lines describes one event with three integers Q, A, and B. (Q is 0 or 1, 0 ≤ A ≤ B < N)
When Q is 0, Jinil swaps the disc in slot A with the disc in slot B.
When Q is 1, a customer brings the discs in slots A to B to the counter. As stated above, this event never moves a disc.
Print one line for every event with Q equal to 1. If the discs the customer brought hold every disc from A to B, in any order, print YES. Otherwise print NO.