#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 105;
vector<vector<int> > graph(N);
vector<pair<int, int> > intervals(N);
int it = 1;
int x, a, b;
bool vis[N];
bool dfs(int k) {
  if (k == b) return 1;
  vis[k] = 1;
  for (int i = 0; i < graph[k].size(); ++i) {
    int node = graph[k][i];
    if (!vis[node] && dfs(node)) return 1;
  }
  return 0;
}
int main() {
  scanf("%d", &n);
  while (n--) {
    scanf("%d %d %d", &x, &a, &b);
    if (x == 1) {
      intervals[it] = make_pair(a, b);
      for (int i = it - 1; i > 0; --i) {
        int c = intervals[i].first, d = intervals[i].second;
        if ((a > c && a < d) || (b > c && b < d)) graph[it].push_back(i);
        if ((c > a && c < b) || (d > a && d < b)) graph[i].push_back(it);
      }
      ++it;
    } else {
      memset(vis, 0, sizeof vis);
      puts(dfs(a) ? "YES" : "NO");
    }
  }
  return 0;
}
