Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then value 800 ms will be displayed and used to determine the verdict.

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

E. Ping-Pong

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputIn this problem at each moment you have a set of intervals. You can move from interval (*a*, *b*) from our set to interval (*c*, *d*) from our set if and only if *c* < *a* < *d* or *c* < *b* < *d*. Also there is a path from interval *I*_{1} from our set to interval *I*_{2} from our set if there is a sequence of successive moves starting from *I*_{1} so that we can reach *I*_{2}.

Your program should handle the queries of the following two types:

- "1 x y" (
*x*<*y*) — add the new interval (*x*,*y*) to the set of intervals. The length of the new interval is guaranteed to be strictly greater than all the previous intervals. - "2 a b" (
*a*≠*b*) — answer the question: is there a path from*a*-th (one-based) added interval to*b*-th (one-based) added interval?

Answer all the queries. Note, that initially you have an empty set of intervals.

Input

The first line of the input contains integer *n* denoting the number of queries, (1 ≤ *n* ≤ 10^{5}). Each of the following lines contains a query as described above. All numbers in the input are integers and don't exceed 10^{9} by their absolute value.

It's guaranteed that all queries are correct.

Output

For each query of the second type print "YES" or "NO" on a separate line depending on the answer.

Examples

Input

5

1 1 5

1 5 11

2 1 2

1 2 9

2 1 2

Output

NO

YES

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/15/2019 18:00:46 (e1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|