#include <bits/stdc++.h>
using namespace std;
vector<int> v[101];
bool vis[101];
void dfs(int nod, int dest, int &flag) {
  int i;
  vis[nod] = 1;
  if (nod == dest) {
    flag = 1;
    return;
  }
  for (i = 0; i < v[nod].size(); i++) {
    int current = v[nod][i];
    if (vis[current] == 0) {
      dfs(current, dest, flag);
    }
  }
  return;
}
int main() {
  int q, c, d, nod = 0, i, op, j;
  cin >> q;
  pair<int, int> pr[101];
  while (q--) {
    cin >> op >> c >> d;
    if (op == 1) {
      nod++;
      pr[nod] = make_pair(c, d);
      for (i = 1; i < nod; i++) {
        int a = pr[i].first;
        int b = pr[i].second;
        if ((c < a && a < d) || (c < b && b < d)) {
          v[i].push_back(nod);
        }
        if ((a < c && c < b) || (a < d && d < b)) {
          v[nod].push_back(i);
        }
      }
    } else {
      memset(vis, 0, sizeof(vis));
      int flag = 0;
      dfs(c, d, flag);
      if (flag == 1) {
        cout << "YES";
      } else {
        cout << "NO";
      }
      cout << endl;
    }
  }
  return 0;
}
