#include <bits/stdc++.h>
using namespace std;
struct pii {
  long long i, first, second;
};
bool comp(pii a, pii b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
void dfs(long long node, vector<long long> adj[], vector<long long> &vis) {
  vis[node] = 1;
  for (long long child : adj[node]) {
    if (!vis[child]) dfs(child, adj, vis);
  }
}
void work() {
  long long q;
  cin >> q;
  vector<pii> inv;
  long long type, x, y, a, b, n = 0;
  vector<long long> adj[100];
  while (q--) {
    cin >> type;
    if (type == 1) {
      cin >> x >> y;
      n++;
      inv.push_back({n, x, y});
      for (long long i = 0; i < n - 1; i++) {
        if ((inv[i].first < inv[n - 1].first &&
             inv[n - 1].first < inv[i].second) ||
            (inv[i].first < inv[n - 1].second &&
             inv[n - 1].second < inv[i].second))
          adj[inv[n - 1].i].push_back(inv[i].i);
        if ((inv[n - 1].first < inv[i].first &&
             inv[i].first < inv[n - 1].second) ||
            (inv[n - 1].first < inv[i].second &&
             inv[i].second < inv[n - 1].second))
          adj[inv[i].i].push_back(inv[n - 1].i);
      }
    } else {
      cin >> a >> b;
      vector<long long> vis(n + 1, 0);
      dfs(a, adj, vis);
      if (vis[b])
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    work();
  }
  return 0;
}
