#include <bits/stdc++.h>
using namespace std;
const int Maxn = 205, Maxm = 100005, Mo = 1000000007,
          s[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
const long long oo = LLONG_MAX >> 1;
struct Tree {
  int l, r;
};
struct edge {
  int u, v, c, l;
};
struct point {
  long long x, y;
};
typedef int IArr[Maxn];
typedef long long LArr[Maxn];
typedef double DArr[Maxn];
int i, j, k, n, cnt;
IArr l, r, id;
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  while (n--) {
    int op;
    cin >> op;
    if (op == 1) {
      cin >> l[++cnt];
      cin >> r[cnt];
      id[cnt] = cnt;
    } else {
      int a, b;
      cin >> a >> b;
      int use[500];
      memset((use), 0, sizeof((use)));
      queue<int> Q;
      Q.push(a);
      use[a] = 1;
      int can = 0;
      while (Q.size()) {
        int d = Q.front();
        if (d == b) {
          can = 1;
          break;
        }
        Q.pop();
        for (i = 1; i <= cnt; i++)
          if (!use[i]) {
            if (l[i] < l[d] && l[d] < r[i]) {
              Q.push(i);
              use[i] = 1;
            } else if (l[i] < r[d] && r[d] < r[i]) {
              Q.push(i);
              use[i] = 1;
            }
          }
      }
      if (can)
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
}
