#include <bits/stdc++.h>
using namespace std;
vector<int> graph[100005];
int n, x, y, a, T1[100005], T2[100005], s = 0, i;
int H[100005];
void add_path(int x) {
  for (int i = 1; i < s; i++) {
    if ((T1[x] < T1[i] and T1[i] < T2[x]) or (T1[x] < T2[i] and T2[i] < T2[x]))
      graph[i].push_back(s);
    if ((T1[i] < T1[x] and T1[x] < T2[i]) or (T1[i] < T2[x] and T2[x] < T2[i]))
      graph[s].push_back(i);
  }
}
int dfs(int a) {
  if (a == y) return 1;
  H[a] = 1;
  int ans = 0;
  for (int i = 0; i < graph[a].size(); i++) {
    if (!H[graph[a][i]]) {
      ans = max(dfs(graph[a][i]), ans);
    }
  }
  return ans;
}
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a >> x >> y;
    if (a == 1) {
      T1[++s] = x, T2[s] = y;
      add_path(s);
    } else if (dfs(x))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    memset(H, 0, sizeof H);
  }
  return 0;
}
