#include <bits/stdc++.h>
using namespace std;
int n, p, f, l, r;
pair<int, int> pi[105];
bool used[105];
int main() {
  cin >> n;
  p = 1;
  for (int k = 0; k < n; k++) {
    int op;
    cin >> op;
    if (op == 1) {
      cin >> l >> r;
      pi[p].first = l;
      pi[p].second = r;
      p++;
    } else {
      cin >> l >> r;
      for (int i = 0; i <= 100; i++) used[i] = 0;
      f = 0;
      used[l] = true;
      queue<int> que;
      que.push(l);
      while (!que.empty()) {
        int x = que.front();
        if (x == r) f = 1;
        que.pop();
        for (int i = 1; i < p; i++) {
          if (!used[i]) {
            if (pi[i].first < pi[x].first && pi[i].second > pi[x].first ||
                pi[i].first < pi[x].second && pi[i].second > pi[x].second) {
              que.push(i);
              used[i] = true;
            }
          }
        }
      }
      if (f)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
}
