#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, A = 1e3 + 5;
bool vis[105];
vector<vector<long long>> v;
void dfs(long long node) {
  for (auto to : v[node])
    if (!vis[to]) vis[to] = 1, dfs(to);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<pair<long long, long long>> a;
  map<long long, set<long long>> mop;
  for (int i = 0; i < n; i++) {
    long long op, l, r;
    cin >> op >> l >> r;
    if (op == 1)
      a.push_back({l, r});
    else {
      v.resize(a.size() + 1);
      for (int i = 0; i < a.size(); i++) {
        for (int j = 0; j < a.size(); j++) {
          if ((a[i].first > a[j].first && a[i].first < a[j].second) ||
              (a[i].second > a[j].first && a[i].second < a[j].second))
            v[i + 1].push_back(j + 1);
        }
      }
      vis[l] = 1, dfs(l);
      vis[r] ? cout << "YES\n" : cout << "NO\n";
      memset(vis, 0, sizeof vis), v.clear();
    }
  }
  return 0;
}
