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
/*
 ~/BAU/ACM-ICPC/Teams/Rampage/MMZA
 ~/sudo apt-get verdict Accepted
 practice...
*/
//package javaapplication1;

//import java.util.Scanner;


import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
    static final int Mod=(int)1e9+7;
    static final int N=(int)100+5;
    static boolean vis[]=new boolean[N];
    static List<Integer> g[]=new List[N];
    static {
        for(int i=0;i<N;i++)
            g[i]=new ArrayList();
    }
    public static void main(String[] args) throws IOException {
       // Reader.init(System.in);
        //Scanner in=new Scanner(new FileInputStream("input.txt"));
        FastReader in=new FastReader();
        StringBuilder sb=new StringBuilder();
        //in=new FileReader("input.txt");
        //PrintWriter out=new PrintWriter(new FileOutputStream("output.txt"));
        PrintWriter out=new PrintWriter(System.out);           
        Main ob=new Main();
        int q=in.nextInt();
        
        ArrayList<pair> arr=new ArrayList();
        int pp=1;
        while(q-->0){
            int t=in.nextInt(),s=in.nextInt(),e=in.nextInt();
            if(t==1){
                 for(int i=0;i<arr.size();i++){
                    pair p=arr.get(i); 
                    if((p.first>s&&p.first<e)||(p.second>s&&p.second<e)){
                        g[i+1].add(pp);
                    }
                    if((s>p.first&&s<p.second)||(e>p.first&&e<p.second)){
                        g[pp].add(i+1);
                    }
                 }
                 arr.add(new pair(s,e));
                 pp++;
            }
            else{
                Arrays.fill(vis, false);
                dfs(s);
                if(vis[e])
                    out.println("YES");
                else out.println("NO");
            }
        }
        out.close();
    }
    static void dfs(int u){
        vis[u]=true;
        for(int i=0;i<g[u].size();i++){
            int v=g[u].get(i);
            if(!vis[v])
                dfs(v);
        }
    }
    static int[] reverse(int [] arr){
        ArrayList<Integer> temp=new ArrayList();
        for(int i=0;i<arr.length;i++)
            temp.add(arr[i]);
        Collections.reverse(temp);
        for(int i=0;i<temp.size();i++)
            arr[i]=temp.get(i);
        return arr;
    }
    static String reverse(String s){
        String temp="";
        for(int i=s.length()-1;i>=0;i--)
            temp+=s.charAt(i);
        return temp;
    }
    static String sort(String inputString) 
    { 
        ArrayList<Character> arr=new ArrayList();
        for(int i=0;i<inputString.length();i++)
            arr.add(inputString.charAt(i));
        Collections.sort(arr);
        StringBuilder sb=new StringBuilder();
        for(int i=0;i<arr.size();i++)
            sb.append(arr.get(i));
        
        return sb.toString(); 
    } 
     
    static boolean next_permutation(int[] p, int len) {
        int a = len - 2;
        while (a >= 0 && p[a] >= p[a + 1]) {
            a--;
        }

        if (a == -1) {
            return false;
        }

        int b = len - 1;
        while (p[b] <= p[a]) {
            b--;
        }

        p[a] += p[b];
        p[b] = p[a] - p[b];
        p[a] -= p[b];

        for (int i = a + 1, j = len - 1; i < j; i++, j--) {
            p[i] += p[j];
            p[j] = p[i] - p[j];
            p[i] -= p[j];
        }

        return true;
    }
    static int lower_bound(ArrayList<Integer> arr,int key) {
        int len = arr.size();
        int lo = 0;
        int hi = len-1;
        int mid = (lo + hi)/2;
        while (true) {
            int cmp = (arr.get(mid)==key?1:0);
            if (cmp == 0 || cmp > 0) {
                hi = mid-1;
                if (hi < lo)
                    return mid;
            } else {
                lo = mid+1;
                if (hi < lo)
                    return mid<len-1?mid+1:-1;
            }
            mid = (lo + hi)/2;
        }
    }
    static int upper_bound(ArrayList<Integer> arr, int key) {
        int len = arr.size();
        int lo = 0;
        int hi = len-1;
        int mid = (lo + hi)/2;
        while (true) {
            int cmp = (arr.get(mid)==key?1:0);
            if (cmp == 0 || cmp < 0) {
                lo = mid+1;
                if (hi < lo)
                    return mid<len-1?mid+1:-1;
            } else {
                hi = mid-1;
                if (hi < lo)
                    return mid;
            }
            mid = (lo + hi)/2;
        }
    }
    static int gcd(int a,int b){
        return b==0?a:gcd(b,a%b);
    } 
    static double dot(Point p,Point q){
        return (p.x*q.x+p.y*q.y);
    }
    static double cross(Point p,Point q){
        return (p.x*q.y-p.y*q.x);
    }
    static Point computeLineIntersection(Point a,Point b,Point c,Point d){
        b=b.sub(a);d=c.sub(d);c=c.sub(a);
        return a.add(b.mulCon(cross(c,d)).devideCon(cross(b,d)));
    }
   static class FastReader 
        { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            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; 
        } 
    } 
  
}
class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(
                new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    static void init(String url) throws FileNotFoundException {
        reader = new BufferedReader(new FileReader(url));
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static String nextLine() throws IOException {
        return reader.readLine();
    }

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

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

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}
class Point{    
    double x,y;
    Point(double _x,double _y){
        x=_x;
        y=_y;
    }
    Point add(final Point p){
        return new Point(x+p.x,y+p.y);
    }
    Point sub(final Point p){
        return new Point(x-p.x,y-p.y);
    }
    Point mulCon(final double c){
        return new Point(c*x,c*y);
    }
    Point devideCon(final double c){
        return new Point(x/c,y/c);
    }
}
class  pair implements Comparator<pair>{
    int  first;
    int  second;
    //int third;
    pair(){}
    pair(int a,int s){
        first = a;
        second = s;
        //third=t;
    }
    
   /* pair(pair a,pair b){
        first = a;
        second = b;
    }*/
    @Override 
    public int compare(pair a,pair b){
        return (a.first-b.first);
    }
}
