#include <bits/stdc++.h>
using namespace std;
int n, q, c, a, b;
bool vis[132];
vector<pair<int, int> > ve;
void dfs(int cur) {
  if (vis[cur]) return;
  vis[cur] = 1;
  for (int i = 0; i < ve.size(); i++) {
    if (ve[i].first < ve[cur].first && ve[cur].first < ve[i].second ||
        ve[i].first < ve[cur].second && ve[cur].second < ve[i].second)
      dfs(i);
  }
}
bool query(int a, int b) {
  memset(vis, 0, sizeof(vis));
  dfs(a);
  return vis[b] == 1;
}
int main() {
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> c >> a >> b;
    if (c == 1) {
      ve.push_back(make_pair(a, b));
    } else {
      if (query(a - 1, b - 1))
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
