#include <bits/stdc++.h>
using namespace std;
vector<int> g[105];
int vis[105];
struct node {
  int id, x, y;
} a[105];
void dfs(int x) {
  vis[x] = 1;
  for (int i = 0; i < g[x].size(); i++) {
    int t = g[x][i];
    if (vis[t]) continue;
    dfs(t);
  }
}
bool check(int i, int j) {
  if (a[j].x < a[i].x && a[j].y > a[i].x) return true;
  if (a[j].x < a[i].y && a[j].y > a[i].y) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    int kind, x, y;
    cin >> kind >> x >> y;
    if (kind == 1) {
      cnt++;
      a[cnt].x = x;
      a[cnt].y = y;
      for (int j = 1; j < cnt; j++) {
        if (check(j, cnt)) g[j].push_back(cnt);
        if (check(cnt, j)) g[cnt].push_back(j);
      }
    } else {
      memset(vis, 0, sizeof(vis));
      dfs(x);
      if (vis[y])
        cout << "YES" << '\n';
      else
        cout << "NO" << '\n';
    }
  }
  return 0;
}
