#include <bits/stdc++.h>
using namespace std;
void DFS_VISIT(int);
int color[105] = {0};
const int MAX_LIM = 9999999, WHITE = 0, GRAY = 1, BLACK = 2, NIL = -1;
vector<vector<pair<int, int> > > graph, rgraph;
int a, b, c, d, global = 0, res;
void DFS_VISIT(int u) {
  int node;
  color[u] = GRAY;
  for (typeof(graph[u].begin()) it = graph[u].begin(); it != graph[u].end();
       it++) {
    node = (*it).first;
    if (node == res) {
      global = 1;
      return;
    }
    if (color[node] == WHITE) {
      if (node == res) {
        global = 1;
        return;
      }
      DFS_VISIT(node);
    }
  }
  color[u] = BLACK;
  return;
}
int main() {
  int i, j, k, n, m, len, f, arr[105][3], q, r, x;
  pair<int, int> p;
  graph.resize(105);
  cin >> n;
  p.second = 0;
  x = 1;
  for (i = 1; i <= n; i++) {
    cin >> k >> q >> r;
    if (k == 1) {
      arr[x][0] = q;
      arr[x][1] = r;
      for (j = 1; j < x; j++) {
        p.first = j;
        if ((q > arr[j][0] && q < arr[j][1]) ||
            (r > arr[j][0] && r < arr[j][1]))
          graph[x].push_back(p);
        p.first = x;
        if ((arr[j][0] > q && r > arr[j][0]) ||
            (q < arr[j][1] && r > arr[j][1]))
          graph[j].push_back(p);
      }
      x++;
    } else if (k == 2) {
      global = 0;
      a = arr[q][0];
      b = arr[q][1];
      c = arr[r][0];
      d = arr[r][1];
      if ((a > c && a < d) || (b > c && b < d))
        cout << "YES" << endl;
      else {
        for (j = 0; j <= 105; j++) color[j] = WHITE;
        res = r;
        DFS_VISIT(q);
        if (global)
          cout << "YES" << endl;
        else
          cout << "NO" << endl;
      }
    }
  }
  return 0;
}
