#include <bits/stdc++.h>
using namespace std;
const int z = 105;
vector<pair<int, int>> v;
bool vis[z];
void dfs(int p) {
  if (vis[p]) {
    return;
  } else {
    vis[p] = true;
    int x = v[p].first;
    int y = v[p].second;
    for (int i = 0; i < (int)v.size(); i++) {
      if (!vis[i]) {
        if ((x > v[i].first && (x < v[i].second))) {
          dfs(i);
        } else {
          if (((y > v[i].first) && (y < v[i].second))) {
            dfs(i);
          }
        }
      }
    }
  }
}
signed main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    if (t == 1) {
      int l, r;
      cin >> l >> r;
      v.push_back(make_pair(l, r));
    } else {
      memset(vis, false, sizeof(vis));
      int w, e;
      cin >> w >> e;
      w--;
      e--;
      dfs(w);
      if (vis[e]) {
        cout << "YES\n";
      } else {
        cout << "NO\n";
      }
    }
  }
}
