#include <bits/stdc++.h>
using namespace std;
const int INFint = 2147483647;
const long long INF = 9223372036854775807ll;
const long long MOD = 1000000007ll;
const long double EPS = 1e-9;
int p[1000];
int a[1000];
int b[1000];
int cnt;
void dfs(int v) {
  p[v] = 1;
  for (int i = 1; i <= cnt; i++) {
    if (!p[i]) {
      if ((a[v] > a[i] && a[v] < b[i]) || (b[v] > a[i] && b[v] < b[i])) dfs(i);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      cnt++;
      a[cnt] = x;
      b[cnt] = y;
    } else {
      memset(p, 0, sizeof(p));
      dfs(x);
      if (p[y]) {
        cout << "YES" << endl;
      } else
        cout << "NO" << endl;
    }
  }
  fprintf(stderr, "\nTIME = %lf\n", 1.0 * clock() / CLOCKS_PER_SEC);
  return 0;
}
