#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
struct node {
  int a, b, id;
  node(int aa = 0, int bb = 0, int idd = 0) : a(aa), b(bb), id(idd) {}
} data[maxn];
int sum = 1;
int visit[maxn] = {0};
bool check(int a, int b) {
  if ((data[a].a > data[b].a && data[a].a < data[b].b) ||
      (data[a].b > data[b].a && data[a].b < data[b].b))
    return true;
  return false;
}
void dfs(int s) {
  memset(visit, 0, sizeof(visit));
  queue<int> q;
  q.push(s);
  int p;
  while (!q.empty()) {
    p = q.front();
    q.pop();
    for (int i = 1; i < sum; i++) {
      if (!visit[i])
        if (check(p, i)) q.push(i), visit[i] = 1;
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  int t, a, b;
  while (n--) {
    scanf("%d%d%d", &t, &a, &b);
    if (t == 1) {
      data[sum++] = node(a, b);
    } else {
      dfs(a);
      if (visit[b])
        puts("YES");
      else
        puts("NO");
    }
  }
}
