#include <bits/stdc++.h>
using namespace std;
int main() {
  int left[200];
  int right[200];
  int n;
  scanf("%d", &n);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int op, x, y;
    scanf("%d%d%d", &op, &x, &y);
    if (op == 1) {
      left[cnt] = x;
      right[cnt] = y;
      cnt++;
      continue;
    }
    if (op == 2) {
      x--;
      y--;
      int l = left[y];
      int r = right[y];
      for (int k = 0; k < cnt; k++) {
        for (int j = 0; j < cnt; j++) {
          if ((l < left[j] && left[j] < r) || (l < right[j] && right[j] < r)) {
            l = min(l, left[j]);
            r = max(r, right[j]);
            if (j == x) {
              printf("YES\n");
              goto next;
            }
          }
        }
      }
      printf("NO\n");
    }
  next:;
  }
  return 0;
}
