#include <bits/stdc++.h>
int cnt = 0, visit[100], suc;
struct Node {
  int x, y;
} map[100];
void cal(int now, int to) {
  if (now == to) {
    suc = 1;
    return;
  }
  visit[now] = 1;
  for (int i = 0; i < cnt; i++) {
    if (i == now || visit[i]) continue;
    if ((map[i].x < map[now].x && map[i].y > map[now].x) ||
        (map[i].x < map[now].y && map[i].y > map[now].y))
      cal(i, to);
    if (suc) return;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  while (n--) {
    int input, x, y;
    scanf("%d%d%d", &input, &x, &y);
    if (input == 1) {
      map[cnt++] = (Node){x, y};
    } else {
      suc = 0;
      memset(visit, 0, sizeof(visit));
      cal(x - 1, y - 1);
      if (suc)
        puts("YES");
      else
        puts("NO");
    }
  }
}
