#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> P;
bool used[111];
int pos;
bool ok(int T) {
  if (T == pos) return true;
  used[T] = true;
  for (int i = 0; i < P.size(); i++) {
    if (used[i] == false) {
      if (P[T].first > P[i].first && P[T].first < P[i].second ||
          P[T].second > P[i].first && P[T].second < P[i].second) {
        used[i] = true;
        if (ok(i)) return true;
      }
    }
  }
  return false;
}
string ans(int l, int r) {
  pos = r;
  for (int i = 0; i < 111; i++) used[i] = false;
  if (ok(l)) return "YES";
  return "NO";
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int type;
    cin >> type;
    if (type == 1) {
      int a, b;
      cin >> a >> b;
      P.push_back(make_pair(a, b));
    } else {
      int l, r;
      cin >> l >> r;
      l--;
      r--;
      cout << ans(l, r) << endl;
    }
  }
  return 0;
}
