#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > mv;
map<long long, bool> mm;
bool cmp(pair<long long, long long> x, pair<long long, long long> y) {
  if (y.first < x.first && x.first < y.second) {
    return true;
  }
  if (y.first < x.second && x.second < y.second) {
    return true;
  }
  return false;
}
bool dfs(long long sink, long long ind) {
  if (mm.find(ind) == mm.end()) {
    mm[ind] = 0;
  } else {
    return mm[ind];
  }
  if (ind == sink) {
    mm[sink] = true;
    return true;
  }
  for (long long lv = 0; lv < mv.size(); lv++) {
    if (lv == ind) {
      continue;
    }
    if (cmp(mv[ind], mv[lv])) {
      if (dfs(sink, lv)) {
        mm[ind] = true;
        return true;
      }
    }
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  long long q;
  cin >> q;
  for (long long lv = 0; lv < q; lv++) {
    long long type;
    cin >> type;
    long long x, y;
    cin >> x >> y;
    if (type == 1) {
      mv.push_back(make_pair(x, y));
    } else {
      mm.clear();
      if (dfs(y - 1, x - 1)) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
  return 0;
}
