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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Sanket Makani
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        static boolean isReachable = false;

        public void solve(int testNumber, InputReader sc, PrintWriter w) {

            ArrayList<Pair> list = new ArrayList<>();

            ArrayList<Integer> list1[] = new ArrayList[101];

            for (int i = 0; i <= 100; i++)
                list1[i] = new ArrayList<>();

            list.add(new Pair(0, 0, 0)); //temporary

            int q = sc.nextInt();
            int count = 1;
            while (q-- > 0) {
                int id = sc.nextInt();

                if (id == 1) {
                    Pair pair = new Pair(sc.nextInt(), sc.nextInt(), count);
                    for (int i = 1; i < list.size(); i++) {
                        if (check(list.get(i), pair)) {
                            list1[list.get(i).id].add(count);
                        }

                        if (check(pair, list.get(i))) {
                            list1[count].add(list.get(i).id);
                        }
                    }
                    list.add(pair);
                    count++;
                } else {
                    int u = sc.nextInt();
                    int v = sc.nextInt();

                    isReachable = false;
                    int visit[] = new int[count];
                    dfs(u, v, list1, visit);

                    if (isReachable)
                        w.println("YES");
                    else
                        w.println("NO");

                }
            }

        }

        private void dfs(int u, int v, ArrayList<Integer>[] list, int[] visit) {

            if (u == v) {
                isReachable = true;
                return;
            }

            if (isReachable)
                return;

            if (visit[u] != 0)
                return;
            visit[u]++;
            for (int in : list[u]) {
                if (visit[in] == 0)
                    dfs(in, v, list, visit);
            }


        }

        private boolean check(Pair pair, Pair pair1) {

            return (pair1.x < pair.x && pair.x < pair1.y) || (pair1.x < pair.y && pair.y < pair1.y);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class Pair implements Comparable<Pair> {
        int x;
        int y;
        int id;

        public Pair(int x, int y, int id) {
            this.x = x;
            this.y = y;
            this.id = id;
        }

        public int compareTo(Pair pair) {
            return 1;
        }

        public String toString() {
            return x + " " + y;
        }

    }
}

