#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 * 3 + 100;
int in[MAXN][MAXN];
vector<int> a[MAXN];
vector<pair<int, int> > d;
bool mark[MAXN];
void dfs(int v) {
  mark[v] = true;
  for (int i = 0; i < a[v].size(); i++) {
    if (mark[a[v][i]] == false) dfs(a[v][i]);
  }
}
int main() {
  int n, m, k, l, t = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m >> l >> k;
    if (m == 1) {
      d.push_back(make_pair(l, k));
      for (int j = 0; j < t; j++)
        if ((d[j].first < l and d[j].second > l) or
            (d[j].first < k and d[j].second > k))
          a[t].push_back(j);
      for (int j = 0; j < t; j++)
        if ((d[j].first > l and d[j].first < k) or
            (d[j].second > l and d[j].second < k))
          a[j].push_back(t);
      t++;
    } else {
      for (int i = 0; i < n; i++) mark[i] = false;
      dfs(l - 1);
      if (mark[k - 1] == true)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
