#include <bits/stdc++.h>
using namespace std;
int a[105], b[105], n, k;
bool f[105];
void dfs(int i) {
  f[i] = true;
  for (int k = 1; k <= n; k++) {
    if (f[k]) continue;
    if (a[i] > a[k] && a[i] < b[k])
      dfs(k);
    else if (b[i] > a[k] && b[i] < b[k])
      dfs(k);
  }
}
void setup() { cin >> k; }
void work() {
  while (k--) {
    int x, y, m;
    cin >> m;
    if (m == 1) {
      n++;
      cin >> a[n] >> b[n];
    } else {
      cin >> x >> y;
      memset(f, 0, sizeof(f));
      dfs(x);
      if (f[y])
        cout << "YES" << '\n';
      else
        cout << "NO" << '\n';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  setup();
  work();
  return 0;
}
