#include <bits/stdc++.h>
using namespace std;
struct a {
  int start, end;
} A[105];
int visit[105] = {0};
void dfs(int i, int n) {
  int j;
  visit[i] = 1;
  for (j = 1; j <= n; j++)
    if (!visit[j]) {
      if ((A[i].end > A[j].start) && (A[i].end < A[j].end))
        dfs(j, n);
      else if ((A[i].start > A[j].start) && (A[i].start < A[j].end))
        dfs(j, n);
    }
}
int main() {
  int n, i, j, k;
  cin >> n;
  for (i = 1, k = 1; i <= n; i++) {
    int t, s, e;
    cin >> t;
    if (t == 1) {
      cin >> s >> e;
      A[k].start = s;
      A[k].end = e;
      k++;
    } else {
      for (j = 1; j <= n; j++) visit[j] = 0;
      cin >> s >> e;
      dfs(s, k - 1);
      if (visit[e])
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
