#include <bits/stdc++.h>
using namespace std;
vector<int> v1[100005];
bool vis[100005];
void dfs(int s) {
  int i;
  vis[s] = true;
  for (i = 0; i < v1[s].size(); i++) {
    if (vis[v1[s][i]] == false) dfs(v1[s][i]);
  }
}
int main() {
  int q, t, x, y, i, a, b;
  vector<pair<int, int> > v;
  cin >> q;
  while (q--) {
    cin >> t >> x >> y;
    if (t == 1) {
      for (i = 0; i < v.size(); i++) {
        a = v[i].first;
        b = v[i].second;
        if (a > x && a < y || b > x && b < y) v1[i + 1].push_back(v.size() + 1);
        if (x > a && x < b || y > a && y < b) v1[v.size() + 1].push_back(i + 1);
      }
      v.push_back(make_pair(x, y));
    } else if (t == 2) {
      memset(vis, false, sizeof vis);
      dfs(x);
      if (vis[y] == true)
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
}
