#include <bits/stdc++.h>
using namespace std;
vector<int> g[102];
vector<bool> vis(102);
void dfs(int u) {
  vis[u] = true;
  for (auto x : g[u]) {
    if (vis[x]) continue;
    dfs(x);
  }
}
void solve() {
  int n;
  cin >> n;
  vector<pair<int, int>> v;
  v.push_back({0, 0});
  while (n--) {
    int o, x, y;
    cin >> o >> x >> y;
    if (o == 1) {
      int m = (int)v.size();
      for (int i = 1; i < m; i++) {
        int a, b;
        a = v[i].first;
        b = v[i].second;
        if ((a < x && x < b) || (a < y && y < b)) {
          g[m].push_back(i);
        }
        if ((x < a && a < y) || (x < b && b < y)) {
          g[i].push_back(m);
        }
      }
      v.push_back(make_pair(x, y));
    } else {
      dfs(x);
      if (!vis[y])
        cout << "NO" << endl;
      else
        cout << "YES" << endl;
      for (int i = 1; i <= 100; i++) vis[i] = false;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int z;
  z = 1;
  for (int z1 = 1; z1 <= z; z1++) {
    solve();
  }
  return 0;
}
