#include <bits/stdc++.h>
using namespace std;
const int xx[] = {0, 1, 0, -1, -1, 1, -1, 1};
const int yy[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int kx[] = {-2, -1, 1, 2, 2, 1, -1, -2};
const int ky[] = {1, 2, 2, 1, -1, -2, -2, -1};
int arr[105];
int brr[105];
bool mark[105];
int X = 0;
void dfs(int x) {
  mark[x] = 1;
  int i;
  for (i = 1; i <= X; i++) {
    if (mark[i]) continue;
    if ((arr[x] > arr[i] && arr[x] < brr[i]) ||
        (brr[x] > arr[i] && brr[x] < brr[i]))
      dfs(i);
  }
}
int main() {
  int i, j, k, x, ans, l, n, mn, t, N_mn, mx, m, u, e, a, b;
  long long int sum;
  char ch, ch1;
  bool key = 1, flag = 1;
  int cs, T;
  scanf("%d", &T);
  for (cs = 1; cs <= T; cs++) {
    scanf("%d", &k);
    if (k == 1) {
      scanf("%d%d", &a, &b);
      X++;
      arr[X] = a;
      brr[X] = b;
    } else {
      scanf("%d%d", &a, &b);
      memset(mark, 0, sizeof(mark));
      dfs(a);
      if (mark[b])
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
