#include <bits/stdc++.h>
using namespace std;
vector<int> a(100);
vector<int> b(100);
vector<int> visited(100, 0);
int num;
void dfs(int u) {
  visited[u] = 1;
  for (int i = 0; i <= num; i++) {
    if (visited[i]) continue;
    if (a[u] > a[i] && a[u] < b[i]) dfs(i);
    if (b[u] > a[i] && b[u] < b[i]) dfs(i);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int> > intervals;
  vector<vector<int> > graph(100);
  while (n--) {
    int type, x, y;
    cin >> type >> x >> y;
    if (type == 1) {
      num++;
      a[num] = x;
      b[num] = y;
    } else {
      fill(visited.begin(), visited.end(), 0);
      dfs(x);
      if (visited[y])
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
  return 0;
}
