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
// Author Andrei Jaume, ping_pong codeforces problem
// Solution using BFS

import java.util.*;
import java.io.*;

public class ping_pong{
	private static int id;
	
	public static class Query implements Comparable<Query> {
		int x, y;
		int id;
		boolean visited;
		public Query(int x, int y) {
			this.x = x;
			this.y = y;
			this.id = id++;
			this.visited = false;
		}
		
		public int compareTo(Query other){
			return Integer.compare(this.id, other.id);
		}
		
		@Override
		public boolean equals(Object other){
			Query temp = (Query)(other);
			if(this.x == temp.x && this.y == temp.y)
				return true;
			return false;
		}
	}
	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);
		id  = 0;		
		int queries = sc.nextInt();
		
		ArrayList<Query> list = new ArrayList<>();
		for (int i = 0; i < queries; i++){
			int n = sc.nextInt();
			int x = sc.nextInt();
			int y = sc.nextInt();
			

			if (n == 1)
				list.add(new Query(x,y));
			else if (n == 2){
				if (bfs(x-1, y-1, list))
					System.out.println("YES");
				else 
					System.out.println("NO");
			}
			for (Query q: list)
				q.visited = false;
		}		
	}
	
	public static boolean bfs(int a, int b, ArrayList<Query> list){
		boolean succed = false;
		Queue<Query> queue = new LinkedList<>();
		Query start = list.get(a);
		start.visited = false;
		queue.add(start);
		
		Query end = list.get(b);
		
		while (!queue.isEmpty()){
			Query current = queue.remove();
			current.visited = true;
			
			if(current.equals(end)){
				succed = true;
				return succed;
			}
			
			for (Query q: list){
				boolean test1 = q.x < current.x && current.x < q.y;
				boolean test2 = q.x < current.y && current.y < q.y;
				if(!q.visited && (test1 || test2))
					queue.add(q);
			}
		}	

		return succed;
	}
}