In 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* &lt; *a* &lt; *d* or *c* &lt; *b* &lt; *d*. Also there is a path from interval *I*<sub class="lower-index">1</sub> from our set to interval *I*<sub class="lower-index">2</sub> from our set if there is a sequence of successive moves starting from *I*<sub class="lower-index">1</sub> so that we can reach *I*<sub class="lower-index">2</sub>.

Your program should handle the queries of the following two types:
 1.  "1 x y" (*x* &lt; *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.1.  "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.
The first line of the input contains integer *n* denoting the number of queries, (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>). Each of the following lines contains a query as described above. All numbers in the input are integers and don't exceed 10<sup class="upper-index">9</sup> by their absolute value.

It's guaranteed that all queries are correct.
n = int(input())


class Graph:

    def __init__(self, V):
        self.V = V
        self.adj = [[] for i in range(V)]

    def DFSUtil(self, temp, v,y, visited):

        visited[v] = True
        if v==y:
            return True

        # temp.append(v)

        for i in self.adj[v]:
            if visited[i] == False:
                temp = self.DFSUtil(temp, i,y, visited)
                if temp==True:
                    return True
        return False

    def addEdge(self, v, w):
        self.adj[v].append(w)
        # self.adj[w].append(v)

    def connectedComponents(self):
        visited = []
        cc = []
        for i in range(self.V):
            visited.append(False)
        for v in range(self.V):
            if visited[v] == False:
                temp = []
                cc.append(self.DFSUtil(temp, v, visited))
        return cc


node_values = [[0,0]]
G=Graph(1)
cpunter=1
for i in range(0, n):
    q, a, b = list(map(lambda x: int(x), input().split()))

    if q == 1:

        G.adj.append([])

        for k in range(1,len(node_values)):

            if a<node_values[k][0]<b or a<node_values[k][1]<b:

                G.addEdge(k,G.V)
            if node_values[k][0]<a<node_values[k][1] or node_values[k][0]<b<node_values[k][1]:
                G.addEdge(G.V,k)
        node_values.append((a,b))
        G.V += 1
    else:
        visited=[False for _ in range(n)]
        if G.DFSUtil(False,a,b,visited):
            print("YES")
        else:
            print("NO")
