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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.StringTokenizer;

public class CodeForces {
    static reader input = new reader();
    static PrintWriter output = new PrintWriter(System.out);
    public static void main(String[] args) throws IOException {
        //BufferedReader bf = new BufferedReader(new FileReader("input.txt"));
        //PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
        //StringTokenizer stk = new StringTokenizer(bf.readLine());
        //int n=Integer.parseInt(stk.nextToken());
        B();
        output.close();
    }
    public static void A(){
        long x=input.nextInt(),m=input.nextInt();
        HashSet<Long>hs=new HashSet<>();
        hs.add((x%m));
        boolean check=true;
        for(int i=0;i<m;i++){
            x=(x+x%m);
            if(x%m==0){
                output.print("Yes");
                check=false;
                break;
            }else if(hs.contains(x%m)){
                output.print("No");
                check=false;
                break;
            }
            hs.add(x%m);
        }
    }

    public static void B(){
        int n=input.nextInt();
        ArrayList<Pair>graph=new ArrayList<>();
        for(int i=0;i<n;i++){
            int c= input.nextInt(),x=input.nextInt(),y=input.nextInt();
            if(c==1){
                graph.add(new Pair(x,y));
            }else{
                x--;
                y--;
                if(helper(graph,x,y)){
                    output.println("YES");
                }else{
                    output.println("NO");
                }
            }
        }
    }
    public static boolean helper(ArrayList<Pair>graph,int src,int dest){
        int n=graph.size();
        boolean visited[]=new boolean[n];
        LinkedList<Pair>q=new LinkedList<>();
        visited[src]=true;
        q.add(graph.get(src));
        while(!q.isEmpty()){
            Pair element=q.poll();
            for(int i=0;i<n;i++){
                if(!visited[i]){
                    if(possible(element,graph.get(i))){
                        if(i==dest)
                            return true;
                        else{
                            visited[i]=true;
                            q.add(graph.get(i));
                        }
                    }
                }
            }
        }
        return false;
    }
    public static boolean possible(Pair src,Pair dest){
        if((src.x>dest.x&&src.x< dest.y)||(src.y>dest.x&&src.y< dest.y))
            return true;
        else
            return false;
    }

    public static void C(){

    }

    public static void D(){

    }

    public static void E(){

    }

    public static void F(){

    }

    public static long factorial(int a){
        long ans=1;
        for(int i=1;i<=a;i++){
            ans*=i;
        }
        return ans;
    }
    public static long LCM(long a,long b){
        return (a*b)/GCD(a,b);
    }
    public static long GCD(long a,long b){
        if(a==0)
            return b;
        else if(b==0)
            return a;
        else
            return GCD(b%a,a);
    }

    public static boolean isPrime(long num){
        if(num==1)
            return false;
        else if(num==2||num==3)
            return true;
        else if(num%2==0||num%3==0)
            return false;
        else{
            for(long i=5;i*i<=num;i+=6){
                if(num%i==0||num%(i+2)==0)
                    return false;
            }
        }
        return true;
    }

    public static ArrayList<Integer> SieveofEratothenis(){
        ArrayList<Integer>ans=new ArrayList<>();
        boolean visited[]=new boolean[1000000];
        for(int i=2;i<1000000;i++){
            if(!visited[i]){
                ans.add(i);
                for(long j=(long)i*i;j<1000000;j+=i){
                    visited[(int)j]=true;
                }
            }
        }
        return ans;
    }

    public static void mergesort(long arr[],int start,int end){//start and end must be indexes
        if(start<end) {
            int mid=(start+end)/2;
            mergesort(arr,start,mid);
            mergesort(arr, mid+1, end);
            merge(arr, start,mid,end);
        }
    }
    public static void merge(long arr[],int start,int mid,int end){
        int lsize=mid-start+1,rsize=end-mid;
        long l[]=new long[lsize],r[]=new long[rsize];
        for(int i=start;i<=mid;i++){
            l[i-start]=arr[i];
        }
        for(int i=mid+1;i<=end;i++){
            r[i-mid-1]=arr[i];
        }
        int i=0,j=0,k=start;
        while(i<lsize&&j<rsize){
            if(l[i]<=r[j]){
                arr[k++]=l[i++];
            }else{
                arr[k++]=r[j++];
            }
        }
        while(i<lsize)
            arr[k++]=l[i++];
        while(j<rsize)
            arr[k++]=r[j++];
    }
}

class Value{
    long ans=0;
    Value(int a){
        ans=a;
    }
}

class Pair{
    long x,y;
    Pair(long x,long y){
        this.x=x;
        this.y=y;
    }
}

class reader {
    BufferedReader br;
    StringTokenizer st;

    public reader() {
        br = new BufferedReader(new
                InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }

    public int[] nextIntArray(int arraySize) {
        int array[] = new int[arraySize];
        for (int i = 0; i < arraySize; i++) {
            array[i] = nextInt();
        }
        return array;
    }

    public long[] nextLongArray(int arraySize) {
        long array[] = new long[arraySize];
        for (int i = 0; i < arraySize; i++) {
            array[i] = nextLong();
        }
        return array;
    }
}
