#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[101][101];
  for (int r = 0; r < 101; r++) {
    for (int g = 0; g < 101; g++) {
      a[r][g] = 12;
    }
  }
  long long intervals[101][101];
  int position = 0;
  for (int r = 0; r < n; r++) {
    long long d, e, f;
    cin >> d >> e >> f;
    if (d == 1) {
      intervals[position][0] = e;
      intervals[position][1] = f;
      position++;
    }
    if (d == 2) {
      e--;
      f--;
      for (int p = 0; p < (position); p++) {
        for (int q = 0; q < (position); q++) {
          if (p == q) {
            a[p][q] = 0;
          } else {
            if (((intervals[q][0] < intervals[p][0]) and
                 (intervals[p][0] < intervals[q][1])) or
                ((intervals[q][0] < intervals[p][1]) and
                 (intervals[p][1] < intervals[q][1]))) {
              a[p][q] = 0;
            }
          }
        }
      }
      for (int g = 0; g < position; g++) {
        for (int h = 0; h < position; h++) {
          for (int i = 0; i < position; i++) {
            if (a[h][i] > a[h][g] + a[g][i]) {
              a[h][i] = a[h][g] + a[g][i];
            }
          }
        }
      }
      if (a[e][f] == 0) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
}
