#include <bits/stdc++.h>
using namespace std;
int n = 1;
int a[102];
int b[102];
bool vis[102];
void dfs(int x) {
  vis[x] = 1;
  for (int y = 1; y < n; y++) {
    if (vis[y])
      continue;
    else {
      if ((a[x] < b[y] && a[x] > a[y]) || (b[x] < b[y] && b[x] > a[y])) dfs(y);
    }
  }
}
int main() {
  int q, x, y, t;
  cin >> q;
  while (q--) {
    cin >> t >> x >> y;
    if (t == 1) {
      a[n] = x;
      b[n] = y;
      n++;
    } else {
      memset(vis, 0, sizeof(vis));
      dfs(x);
      if (vis[y])
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
}
