#include <bits/stdc++.h>
using namespace std;
vector<long long> adj[101];
bool vis[101];
void dfs(long long node) {
  vis[node] = true;
  for (long long x : adj[node]) {
    if (!vis[x]) dfs(x);
  }
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long q;
  cin >> q;
  vector<pair<long long, long long> > ar;
  for (long long tt = 0; tt < q; tt++) {
    long long type, x, y;
    cin >> type >> x >> y;
    if (type == 1) {
      ar.push_back({x, y});
      for (auto it = ar.begin(); it != ar.end(); it++) {
        for (auto jt = ar.begin(); jt != ar.end(); jt++) {
          if ((jt->first > it->first && jt->first < it->second) ||
              (jt->second > it->first && jt->second < it->second)) {
            adj[jt - ar.begin()].push_back(it - ar.begin());
          } else if ((it->first > jt->first && it->first < jt->second) ||
                     (it->second > jt->first && it->second < jt->second)) {
            adj[it - ar.begin()].push_back(jt - ar.begin());
          }
        }
      }
    } else {
      memset(vis, 0, sizeof(vis));
      x--, y--;
      dfs(x);
      if (vis[y])
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
  return 0;
}
