#include <bits/stdc++.h>
using namespace std;
vector<pair<pair<int, int>, vector<int> > > graph(105);
bool pathexist(vector<bool> &visited, int node, int target) {
  visited[node] = true;
  if (node == target) return true;
  for (auto nbr : graph[node].second) {
    if (!visited[nbr]) {
      if (pathexist(visited, nbr, target)) return true;
    }
  }
  return false;
}
void addedge(int node, int s, int e) {
  graph[node].first = {s, e};
  for (int i = 1; i < node; i++) {
    int ss = graph[i].first.first, se = graph[i].first.second;
    if ((ss > s && ss < e) || (se > s && se < e))
      graph[i].second.push_back(node);
    if ((s > ss && s < se) || (e > ss && e < se))
      graph[node].second.push_back(i);
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  int j = 0;
  for (int i = 1; i <= n; i++) {
    int x, a, b;
    cin >> x >> a >> b;
    if (x == 1) {
      j++;
      addedge(j, a, b);
    } else {
      vector<bool> visited(105);
      if (pathexist(visited, a, b))
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
}
