#include <bits/stdc++.h>
using namespace std;
int n;
bool visited[110];
int a[110], b[110];
int l = 0;
void dfs(int curr) {
  visited[curr] = true;
  for (int i = 0; i < l; i++) {
    if (visited[i]) {
      continue;
    }
    if (a[curr] > a[i] and a[curr] < b[i]) {
      dfs(i);
    }
    if (b[curr] > a[i] and b[curr] < b[i]) {
      dfs(i);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  cin >> n;
  l = 0;
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(visited, false, sizeof(visited));
  for (int i = 0; i < n; i++) {
    int tt;
    cin >> tt;
    if (tt == 1) {
      cin >> a[l] >> b[l];
      l++;
    } else {
      int x, y;
      cin >> x >> y;
      memset(visited, false, sizeof(visited));
      dfs(x - 1);
      if (visited[y - 1]) {
        cout << "YES\n";
      } else {
        cout << "NO\n";
      }
    }
  }
  return 0;
}
