#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int a, b, c;
int m;
int OK;
int X[N], Y[N];
int vis[N];
void dfs(int t) {
  vis[t] = 1;
  if (OK) return;
  if (t == c) {
    OK = 1;
    return;
  }
  for (int i = 1; i < m; i++) {
    if (vis[i]) continue;
    if ((X[t] > X[i] && X[t] < Y[i]) || (X[i] < Y[t] && Y[t] < Y[i])) {
      dfs(i);
    }
  }
}
int main() {
  int T;
  cin >> T;
  m = 1;
  while (T--) {
    cin >> a >> b >> c;
    if (a == 1) {
      X[m] = b;
      Y[m] = c;
      m++;
    } else if (a == 2) {
      OK = 0;
      memset(vis, 0, sizeof(vis));
      dfs(b);
      if (OK)
        puts("YES");
      else
        puts("NO");
    }
  }
  return 0;
}
