#include <bits/stdc++.h>
using namespace std;
const int N = 105;
bool vis[N][N], c[N][N];
int n, m, cnt;
bool ok;
struct point {
  int x, y;
} p[N];
void update(int a, int b) {
  for (int i = 1; i < cnt; i++) {
    if (p[i].x < a && a < p[i].y || p[i].x < b && b < p[i].y) c[cnt][i] = 1;
    if (a < p[i].x && p[i].x < b || a < p[i].y && p[i].y < b) c[i][cnt] = 1;
  }
}
void query(int a, int b) {
  if (a == b) {
    ok = true;
    return;
  }
  if (vis[a][b]) return;
  vis[a][b] = 1;
  for (int i = 1; i <= cnt; i++) {
    if (c[a][i]) {
      query(i, b);
    }
  }
}
int main() {
  scanf("%d", &n);
  cnt = 0;
  int t, a, b;
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d", &t, &a, &b);
    if (t == 1) {
      cnt++;
      p[cnt].x = a;
      p[cnt].y = b;
      update(a, b);
    } else {
      ok = false;
      memset(vis, 0, sizeof(vis));
      query(a, b);
      if (ok)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
