#include <bits/stdc++.h>
using namespace std;
int n, t, l[105], h[105], a, b;
int dem = 0;
vector<int> adj[105];
bool vs[105];
void dfs(int v) {
  vs[v] = true;
  for (int i = 0; i < adj[v].size(); ++i) {
    int cur = adj[v][i];
    if (!vs[cur]) dfs(cur);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &t);
    if (t == 1) {
      ++dem;
      scanf("%d %d", &l[dem], &h[dem]);
      for (int i = 1; i < dem; ++i) {
        if (((l[i] > l[dem]) && (l[i] < h[dem])) ||
            ((h[i] > l[dem]) && (h[i] < h[dem])))
          adj[i].push_back(dem);
        if (((l[dem] > l[i]) && (l[dem] < h[i])) ||
            ((h[dem] > l[i]) && (h[dem] < h[i])))
          adj[dem].push_back(i);
      }
    } else {
      scanf("%d %d", &a, &b);
      memset(vs, false, sizeof(vs));
      vs[a] = true;
      dfs(a);
      if (vs[b])
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
}
