#include <bits/stdc++.h>
using namespace std;
int k = 0, x[101], y[101], deg[101], edge[101][101];
bool was[101];
void add(int p, int q) {
  if (((x[p] > x[q]) && (x[p] < y[q])) || ((y[p] > x[q]) && (y[p] < y[q]))) {
    deg[p]++;
    edge[p][deg[p]] = q;
  }
}
void dfs(int u) {
  was[u] = 1;
  for (int i = 1; i <= deg[u]; i++)
    if (!was[edge[u][i]]) dfs(edge[u][i]);
}
int main() {
  int n, z;
  cin >> n;
  for (int hr = 1; hr <= n; hr++) {
    cin >> z;
    if (z == 1) {
      k++;
      cin >> x[k] >> y[k];
      deg[k] = 0;
      for (int i = 1; i <= k - 1; i++) {
        add(i, k);
        add(k, i);
      }
    } else {
      int a, b;
      cin >> a >> b;
      for (int i = 1; i <= k; i++) was[i] = 0;
      dfs(a);
      if (was[b])
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
}
