#include <bits/stdc++.h>
using namespace std;
long long int a[100069], b[100069];
int bfs(long long int x, long long int y, long long int n) {
  queue<int> que;
  que.push(x);
  long long int visited[100069] = {0};
  visited[x] = 1;
  while (!que.empty()) {
    long long int i, v = que.front();
    que.pop();
    if (v == y) {
      return 1;
    }
    for (i = 0; i < n; i++) {
      if (!visited[i] && i != v) {
        if ((a[v] > a[i] && a[v] < b[i]) || (b[v] > a[i] && b[v] < b[i])) {
          que.push(i);
          visited[i] = 1;
        }
      }
    }
  }
  return 0;
}
int main() {
  long long int i, n, m = 1;
  cin >> n;
  for (i = 0; i < n; i++) {
    long long int x, y, z;
    cin >> x >> y >> z;
    if (x == 1) {
      a[m] = y;
      b[m] = z;
      m++;
    } else {
      long long int ans = bfs(y, z, m);
      if (ans == 0)
        cout << "NO\n";
      else
        cout << "YES\n";
    }
  }
  return 0;
}
