#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > V;
bool vis[105];
void DFS(int node) {
  if (vis[node]) return;
  vis[node] = 1;
  for (int i = 0; i < V.size(); i++) {
    bool b1 = V[node].first > V[i].first && V[node].first < V[i].second;
    bool b2 = V[node].second > V[i].first && V[node].second < V[i].second;
    if (b1 || b2) DFS(i);
  }
}
int main() {
  int n;
  while (cin >> n) {
    V.clear();
    int t, x, y;
    for (int i = 0; i < n; i++) {
      cin >> t >> x >> y;
      if (t == 1)
        V.push_back(make_pair(x, y));
      else {
        memset(vis, 0, sizeof vis);
        x--;
        y--;
        DFS(x);
        if (vis[y])
          puts("YES");
        else
          puts("NO");
      }
    }
  }
}
