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