#include <bits/stdc++.h>
using namespace std;
int a[101][2];
bool vst[101] = {0};
bool reach;
void dfs(int s, int e, int n) {
  if (s == e) {
    reach = 1;
    return;
  }
  vst[s] = 1;
  for (int i = 1; i <= n; ++i) {
    if (vst[i]) continue;
    if ((a[s][0] > a[i][0] && a[s][0] < a[i][1]) ||
        (a[s][1] > a[i][0] && a[s][1] < a[i][1])) {
      dfs(i, e, n);
    }
  }
  return;
}
int main() {
  int n, cnt = 0, flag, x, y;
  cin >> n;
  while (n--) {
    cin >> flag >> x >> y;
    if (flag == 1)
      a[++cnt][0] = x, a[cnt][1] = y;
    else {
      memset(vst, 0, sizeof(vst));
      reach = 0;
      dfs(x, y, cnt);
      cout << (reach ? "YES" : "NO") << endl;
    }
  }
  return 0;
}
