#include <bits/stdc++.h>
using namespace std;
int n;
int q, c, d, T = 0;
bool visited[105];
int a[105], b[105];
vector<int> adj[105];
void dfs(int from) {
  visited[from] = true;
  for (int k = 0; k < adj[from].size(); k++) {
    int child = adj[from][k];
    if (!visited[child]) {
      dfs(child);
    }
  }
}
int main() {
  scanf("%d", &n);
  while (n--) {
    scanf("%d%d%d", &q, &c, &d);
    if (q == 2) {
      memset(visited, 0, sizeof(visited));
      dfs(c - 1);
      printf("%s\n", visited[d - 1] == true ? "YES" : "NO");
    } else {
      a[T] = c;
      b[T] = d;
      for (int i = 0; i < T; i++) {
        if ((c < a[i] && a[i] < d) || (c < b[i] && b[i] < d)) {
          adj[i].push_back(T);
        }
        if ((a[i] < c && c < b[i]) || (a[i] < d && d < b[i])) {
          adj[T].push_back(i);
        }
      }
      T++;
    }
  }
  return 0;
}
