#include <bits/stdc++.h>
using namespace std;
int n, k, f[10000], a[10000], b[10000], x, y, h;
void dfs(int q) {
  f[q] = 1;
  for (int i = 1; i <= k; i++) {
    if (f[i]) continue;
    if (a[q] > a[i] && b[i] > a[q]) {
      dfs(i);
    } else if (b[q] > a[i] && b[i] > b[q]) {
      dfs(i);
    }
  }
}
int main() {
  cin >> n;
  k = 1;
  for (int i = 1; i <= n; i++) {
    cin >> h;
    if (h == 1) {
      cin >> a[k] >> b[k];
      k++;
    }
    if (h == 2) {
      cin >> x >> y;
      memset(f, 0, sizeof(f));
      dfs(x);
      if (f[y] == 1) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
  return 0;
}
