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 < a < d or c < b < d. Also there is a path from interval I1 from our set to interval I2 from our set if there is a sequence of successive moves starting from I1 so that we can reach I2.

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

  1. "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. "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 ≤ 100). Each of the following lines contains a query as described above. All numbers in the input are integers and don't exceed 109 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
import java.util.*;

public class cf170{
  public static ArrayList<ArrayList<Integer>> ar;
  public static ArrayList<Boolean> vis;
  public static boolean f;
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        ArrayList<IntegerPair> al=new ArrayList<>();
        
        int i=0;
        int n=sc.nextInt();
        ar=new ArrayList<>();
        
        f=false;
        for(i=0;i<=102;i++)
        {
          ar.add(new ArrayList<>());
        }
        //UnionFind uf=new UnionFind(102);
        int c1=0;
        for(i=0;i<n;i++)
        {
            int a=sc.nextInt();
            int b=sc.nextInt();
            int c=sc.nextInt();
            if(a==1)
            {
              for(int j=0;j<al.size();j++)
              {
                IntegerPair temp=al.get(j);
                int a1=temp.first();
                int b1=temp.second();
                //System.out.println("a= "+a+" b= "+b+" a1= "+a1+" b1="+b1);
                if((b>a1&&b<b1)||(c>a1&&c<b1))
                { 
                  ar.get(c1).add(j);
                  //uf.unionSet(c1,j);
                  //System.out.println(" c1= "+c1+" j= "+j);
                }
                if((a1>b&&a1<c)||(b1>b&&b1<c))
                { 
                  ar.get(j).add(c1);
                  //uf.unionSet(c1,j);
                  //System.out.println(" c1= "+c1+" j= "+j);
                }
              }
              c1++;
              al.add(new IntegerPair(b,c));
            }
            else
            {
              f=false;
              vis=new ArrayList<>(Collections.nCopies(103,false));
              dfs(b-1,c-1);
              if(f)
              {
                System.out.println("YES");
              }
              else
              {
                System.out.println("NO");
              }
            }
            
        }
        //System.out.println(ar);
      /*for(i=0;i<al.size();i++)
        {
          IntegerPair t=al.get(i);
          System.out.println(t.first()+" "+t.second());
        }*/
    }
    public static void dfs(int u,int tar)
    {
      if(f)
      return;
      vis.set(u,true);
      for(Integer v:ar.get(u))
      {
        if(v==tar)
        {
          f=true;
          return;
        }
        if(!vis.get(v))
        {
          dfs(v,tar);
        }
      }
    }
}
class UnionFind {                                              // OOP style
    private ArrayList<Integer> p, rank, setSize;
    private int numSets;
  
    public UnionFind(int N) {
      p = new ArrayList<>(N);
      rank = new ArrayList<>(N);
      setSize = new ArrayList<>(N);
      numSets = N;
      for (int i = 0; i < N; i++) {
        p.add(i);
        rank.add(0);
        setSize.add(1);
      }
    }
  
    public int findSet(int i) { 
      if (p.get(i) == i) return i;
      else {
        int ret = findSet(p.get(i)); p.set(i, ret);
        return ret; } }
  
    public Boolean isSameSet(int i, int j) { return findSet(i) == findSet(j); }
  
    public void unionSet(int i, int j) { 
      if (!isSameSet(i, j)) { numSets--; 
      int x = findSet(i), y = findSet(j);
      // rank is used to keep the tree short
      if (rank.get(x) > rank.get(y)) { p.set(y, x); setSize.set(x, setSize.get(x) + setSize.get(y)); }
      else                           { p.set(x, y); setSize.set(y, setSize.get(y) + setSize.get(x));
                                       if (rank.get(x) == rank.get(y)) rank.set(y, rank.get(y) + 1); } } }
    public int numDisjointSets() { return numSets; }
    public int sizeOfSet(int i) { return setSize.get(findSet(i)); }
  }
  class IntegerPair implements Comparable<IntegerPair> {
    Integer _first, _second;
  
    public IntegerPair(Integer f, Integer s) {
      _first = f;
      _second = s;
    }
  
    public int compareTo(IntegerPair o) {
      if (!this.first().equals(o.first()))
        return this.first() - o.first();
      else
        return this.second() - o.second();
    }
  
    Integer first() { return _first; }
    Integer second() { return _second; }
  }