#include <bits/stdc++.h>
using namespace std;
vector<long long int> adj[105];
long long int f;
long long int visited[105];
void dfs(long long int x, long long int y) {
  visited[x] = 1;
  if (x == y) f = 1;
  for (long long int i = 0; i < adj[x].size(); i++) {
    if (!visited[adj[x][i]]) dfs(adj[x][i], y);
  }
}
int main() {
  long long int q, i;
  vector<pair<long long int, long long int> > a;
  cin >> q;
  while (q--) {
    long long int type, x, y;
    cin >> type >> x >> y;
    if (type == 1) {
      long long int n = a.size();
      for (i = 0; i < n; i++) {
        if ((a[i].first < x && x < a[i].second) ||
            (a[i].first < y && y < a[i].second)) {
          adj[n].push_back(i);
        }
        if ((x < a[i].first && a[i].first < y) ||
            (x < a[i].second && a[i].second < y)) {
          adj[i].push_back(n);
        }
      }
      a.push_back(make_pair(x, y));
    } else {
      --x;
      --y;
      f = 0;
      dfs(x, y);
      for (i = 0; i < 105; i++) visited[i] = 0;
      if (f == 1)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
