#include <bits/stdc++.h>
using namespace std;
long long a[111], b[111];
bool visited[111];
long long j = 0;
void dfs(long long i) {
  visited[i] = true;
  for (long long l = 1; l < j + 1; l++) {
    if (visited[l]) {
      continue;
    }
    if (a[i] > a[l] and a[i] < b[l]) {
      dfs(l);
    } else if (b[i] > a[l] and b[i] < b[l]) {
      dfs(l);
    }
  }
}
signed main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long first, second, z;
    cin >> first;
    if (first == 1) {
      j++;
      cin >> a[j];
      cin >> b[j];
    } else {
      cin >> second >> z;
      memset(visited, 0, sizeof(visited));
      dfs(second);
      if (visited[z]) {
        cout << "YES" << '\n';
      } else {
        cout << "NO" << '\n';
      }
    }
  }
}
