#include <bits/stdc++.h>
using namespace std;
const int N = 105;
struct interval {
  int x, y;
} ins[N];
vector<int> a[N];
int main() {
  int n, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int op, st, ed;
    cin >> op >> st >> ed;
    if (op == 1) {
      ins[cnt].x = st;
      ins[cnt++].y = ed;
      for (int j = 0; j < cnt - 1; j++) {
        if ((ins[j].x < ins[cnt - 1].x && ins[j].y > ins[cnt - 1].x) ||
            (ins[j].x < ins[cnt - 1].y && ins[j].y > ins[cnt - 1].y)) {
          a[cnt].push_back(j + 1);
        }
        if ((ins[cnt - 1].x < ins[j].x && ins[j].x < ins[cnt - 1].y) ||
            (ins[cnt - 1].x < ins[j].y && ins[j].y < ins[cnt - 1].y)) {
          a[j + 1].push_back(cnt);
        }
      }
    } else {
      queue<int> Q;
      Q.push(st);
      bool vis[N];
      memset(vis, 0, sizeof(vis));
      bool flag = false;
      while (!Q.empty()) {
        int u = Q.front();
        Q.pop();
        vis[u] = 1;
        if (u == ed) {
          cout << "YES" << endl;
          flag = true;
          break;
        }
        for (int j = 0; j < a[u].size(); j++) {
          int v = a[u][j];
          if (!vis[v]) Q.push(v);
        }
      }
      if (!flag) cout << "NO" << endl;
    }
  }
  return 0;
}
