#include <bits/stdc++.h>
using namespace std;
int a[101], b[101];
int vis[101];
int n = 0, k;
void dfs(int v) {
  vis[v] = 1;
  int j;
  for (j = 1; j < n + 1; j++) {
    if (vis[j] == false) {
      if (a[v] > a[j] && a[v] < b[j])
        dfs(j);
      else if (b[v] > a[j] && b[v] < b[j])
        dfs(j);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> k;
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(vis, 0, sizeof(vis));
  while (k--) {
    int m, x, y;
    cin >> m;
    if (m == 1) {
      n++;
      cin >> a[n] >> b[n];
    } else {
      cin >> x >> y;
      memset(vis, 0, sizeof(vis));
      dfs(x);
      if (vis[y])
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
  return 0;
}
