#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 7;
int t, n, m, u, v, k, sum = 0;
int book[maxn];
struct node {
  int x, y;
} p[maxn];
void BFS(int u, int v) {
  queue<int> q;
  q.push(u);
  while (!q.empty()) {
    int now = q.front();
    q.pop();
    book[now] = 1;
    for (int i = 1; i <= sum; i++) {
      if (!book[i] && ((p[now].x > p[i].x && p[now].x < p[i].y) ||
                       (p[now].y > p[i].x && p[now].y < p[i].y)))
        q.push(i);
    }
  }
}
int main(void) {
  scanf("%d", &n);
  int opt, u, v;
  for (int i = 0; i < n; i++) {
    scanf("%d %d %d", &opt, &u, &v);
    if (opt == 1)
      p[++sum].x = u, p[sum].y = v;
    else if (opt == 2) {
      memset(book, 0, sizeof(book));
      BFS(u, v);
      if (book[v])
        puts("YES");
      else
        puts("NO");
    }
  }
  return 0;
}
