#include <bits/stdc++.h>
const long long int inf = 10 * (long long int)(INT_MAX);
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int a[110], b[110];
bool vis[111];
int sz;
void search(int i) {
  vis[i] = 1;
  for (int x = 1; x <= sz; x++) {
    if (vis[x]) continue;
    if (a[i] > a[x] && a[i] < b[x]) search(x);
    if (b[i] > a[x] && b[i] < b[x]) search(x);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      sz++;
      a[sz] = x;
      b[sz] = y;
    } else {
      memset(vis, 0, sizeof vis);
      search(x);
      if (vis[y])
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
}
