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 static java.lang.System.*;
import static java.lang.Math.*;

import java.lang.reflect.Array;
import java.util.*;
import java.util.Map.Entry;

public class A320{
    public static Scanner sc = new Scanner(in);
    //public static Random sc=new Random();

    class UnionFind{
        int[] par;
        private int[] rank;
        int size;
        public UnionFind(int n){
            par=new int[n];
            rank=new int[n];
            size=n;
            for(int i=0;i<n;i++){
                par[i]=i;
            }
        }
        public int find(int x){
            if(par[x]==x)return x;
            return par[x]=find(par[x]);
        }
        public boolean same(int x,int y){
            return find(x)==find(y);
        }
        public void unite(int x,int y){
            x=find(x);
            y=find(y);
            if(x==y)return;
            if(rank[x]<rank[y]){
                par[x]=y;
            }else{
                par[y]=x;
                if(rank[x]==rank[y])rank[x]++;
            }
            size--;
        }
    }

    public void run(){
        int n=sc.nextInt();
        UnionFind uf=new UnionFind(n);
        boolean[][] reach=new boolean[n][n];

        int ind=0;
        int[] as=new int[n];
        int[] bs=new int[n];
        for(int i=0;i<n;i++){
            int key=sc.nextInt(),x=sc.nextInt(),y=sc.nextInt();
            if(key==1){
                as[ind]=x;
                bs[ind]=y;
                for(int j=0;j<ind;j++){
                    if((as[j] < x && x<bs[j]) ||(as[j] < y && y<bs[j])){
                        reach[ind][j]=true;
                    }
                    if((x < as[j] && as[j]<y) ||(x < bs[j] && bs[j]<y)){
                        reach[j][ind]=true;
                    }
                }
                for(int k=0;k<=ind;k++)
                    for(int _i=0;_i<=ind;_i++)for(int j=0;j<=ind;j++)
                        if(reach[_i][k] && reach[k][j]){
                            reach[_i][j]=true;
                 }
                ind++;
            }else{
                    ln(reach[x-1][y-1]?"YES":"NO");
            }
        }
   }
    public static void main(String[] _) {
        new A320().run();
    }
    //output lib
    static final String br=System.getProperty("line.separator");
    static final String[] asep=new String[]{""," ",br,br+br};
    static String str(Boolean o){
        return o?"YES":"NO";
    }
//  static String str(Double o){
//      return String.format("%.8f",o);
//  }
    static <K,V> String str(Map<K, V> map){
        StringBuilder sb=new StringBuilder();
        boolean isFirst=true;
        for(Entry<K,V> set:map.entrySet()){
            if(!isFirst)sb.append(br);
            sb.append(str(set.getKey())).append(":").append(str(set.getValue()));
            isFirst=false;
        }
        return sb.toString();
    }
    static <E> String str(Collection<E> list){
        StringBuilder sb=new StringBuilder();
        boolean isFirst=true;
        for(E e:list){
            if(!isFirst)sb.append(" ");
            sb.append(str(e));
            isFirst=false;
        }
        return sb.toString();
    }

    static String str(Object o){
        int depth=_getArrayDepth(o);
        if(depth>0)return _strArray(o,depth);
        Class<?> c=o.getClass();
        if(c.equals(Boolean.class))return str((Boolean)o);
        //if(c.equals(Double.class))return str((Double)o);

        return o.toString();
    }
    static int _getArrayDepth(Object o){
        if(!o.getClass().isArray() || Array.getLength(o)==0) return 0;
        return  1+_getArrayDepth(Array.get(o,0));
    }
    static String _strArray(Object o,int depth){
        if(depth==0) return str(o);
        StringBuilder sb=new StringBuilder();
        for(int i=0,len=Array.getLength(o);i<len;i++){
            if(i!=0)sb.append(asep[depth]);
            sb.append(_strArray(Array.get(o,i),depth-1));
        }
        return sb.toString();
    }
    static void pr(Object... os){
        boolean isFirst=true;
        for(Object o:os){
            if(!isFirst)out.print(" ");
            out.print(o);
            isFirst=false;
        }
    }
    static void ln(){
        out.println();
    }
    static void ln(Object... os){
        for(Object o:os){
            pr(o);ln();
        }
    }
}