#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e9;
const double EPS = (1e-12);
vector<vector<int> > g;
int vis[1005];
int dfs(int s, int d) {
  vis[s] = 1;
  for (int i = 0; i < ((int)((g[s]).size())); ++i) {
    int child = g[s][i];
    if (!vis[child]) {
      if (child == d) return 1;
      int ret = dfs(child, d);
      if (ret) return 1;
    }
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  vector<pair<long long, long long> > v;
  int ind = 0;
  for (int i = 0; i < (int)(n); ++i) {
    long long q, s, d;
    cin >> q >> s >> d;
    if (q == 1) {
      vector<int> temp;
      g.push_back(temp);
      for (int j = 0; j < ((int)((v).size())); ++j) {
        if (((s > v[j].first && s < v[j].second) ||
             (d > v[j].first && d < v[j].second))) {
          g[ind].push_back(j);
        }
        if (((v[j].first > s && v[j].first < d) ||
             (v[j].second > s && v[j].second < d))) {
          g[j].push_back(ind);
        }
      }
      v.push_back(make_pair(s, d));
      ind++;
    } else {
      if (!dfs(s - 1, d - 1))
        cout << "NO" << endl;
      else
        cout << "YES" << endl;
      memset(vis, 0, sizeof(vis));
    }
  }
  return 0;
}
