#include <bits/stdc++.h>
using namespace std;
int ar[102][3];
int edge[102][102], n = 0;
bool isconnected(int a, int b) {
  int i, co[101] = {0};
  queue<int> q;
  q.push(a);
  co[a] = 1;
  while (!q.empty()) {
    int z = q.front();
    q.pop();
    for (i = 0; i < n; i++) {
      if (edge[ar[i][0]][z] == 1 && co[ar[i][0]] == 0) {
        if (ar[i][0] == b) return true;
        q.push(ar[i][0]);
        co[ar[i][0]] = 1;
      }
    }
  }
  if (co[b] == 1) return true;
  return false;
}
int main() {
  int t, i, x, y, z;
  cin >> t;
  while (t--) {
    cin >> x;
    if (x == 1) {
      cin >> y >> z;
      n++;
      ar[n - 1][0] = n;
      ar[n - 1][1] = y;
      ar[n - 1][2] = z;
      for (i = 0; i < (n - 1); i++) {
        if ((ar[i][1] < y && ar[i][2] > y) || (ar[i][1] < z && ar[i][2] > z))
          edge[ar[i][0]][n] = 1;
        if ((ar[i][1] > y && ar[i][1] < z) || (ar[i][2] > y && ar[i][2] < z))
          edge[n][ar[i][0]] = 1;
      }
    }
    if (x == 2) {
      cin >> y >> z;
      if (isconnected(y, z))
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
