#include <bits/stdc++.h>
using namespace std;
bool visited[101];
vector<long long> v[101];
void dfs(long long x) {
  visited[x] = 1;
  for (long long i = 0; i < v[x].size(); i++) {
    if (!visited[v[x][i]]) {
      dfs(v[x][i]);
    }
  }
}
void solve() {
  long long n;
  cin >> n;
  long long q, x, y, idx = 1;
  vector<pair<long long, long long>> p(n + 1);
  map<pair<long long, long long>, long long> mpidx;
  for (long long i = 0; i < n; i++) {
    cin >> q >> x >> y;
    if (q == 1) {
      for (long long i = 1; i < idx; i++) {
        if ((p[i].first < x && x < p[i].second) ||
            (p[i].first < y && y < p[i].second)) {
          v[idx].push_back(i);
        }
        if ((x < p[i].first && p[i].first < y) ||
            (x < p[i].second && p[i].second < y)) {
          v[i].push_back(idx);
        }
      }
      p[idx] = {x, y};
      mpidx[{x, y}] = idx;
      idx++;
    } else {
      memset(visited, 0, sizeof visited);
      dfs(x);
      if (visited[y]) {
        cout << "YES" << endl;
      } else
        cout << "NO" << endl;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
