#include <bits/stdc++.h>
using namespace std;
struct dat {
  int nx, ny;
} a[110];
int vis[110];
int n;
int ans, len, d, c;
int pan(int x, int y) {
  if ((a[x].nx > a[y].nx && a[x].nx < a[y].ny) ||
      (a[x].ny > a[y].nx && a[x].ny < a[y].ny))
    return 1;
  return 0;
}
int dfs(int x, int y) {
  if (x == y) return 1;
  vis[x] = 1;
  for (int i = 0; i < len; i++) {
    if (!vis[i] && pan(x, i) && dfs(i, y)) return 1;
  }
  return 0;
}
int main() {
  scanf("%d", &n);
  len = 0;
  while (n--) {
    scanf("%d", &ans);
    if (ans == 1) {
      scanf("%d %d", &a[len].nx, &a[len].ny);
      len++;
    } else if (ans == 2) {
      scanf("%d %d", &d, &c);
      memset(vis, 0, sizeof(vis));
      if (dfs(d - 1, c - 1))
        puts("YES");
      else
        puts("NO");
    }
  }
  return 0;
}
