#include <bits/stdc++.h>
using namespace std;
const long long maxN = 105;
vector<long long> graph[maxN];
bool visited[maxN];
long long arr[maxN][2];
bool check(long long i, long long j) {
  if ((arr[i][0] > arr[j][0] and arr[i][0] < arr[j][1]) ||
      (arr[i][1] > arr[j][0] and arr[i][1] < arr[j][1])) {
    return 1;
  }
  return 0;
}
bool dfs(long long a, long long b) {
  if (a == b) {
    return 1;
  }
  visited[a] = 1;
  bool ans = 0;
  for (auto it : graph[a]) {
    if (visited[it]) continue;
    ans |= dfs(it, b);
  }
  return ans;
}
int main() {
  long long n, i, j, k, no = 1;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    long long a, b, c;
    scanf("%lld %lld %lld", &a, &b, &c);
    if (a == 1) {
      arr[no][0] = b;
      arr[no][1] = c;
      for (j = 1; j < no; j++) {
        if (check(j, no)) {
          graph[j].push_back(no);
        }
        if (check(no, j)) {
          graph[no].push_back(j);
        }
      }
      no++;
    } else {
      memset(visited, 0, maxN);
      if (dfs(b, c)) {
        printf("YES\n");
      } else {
        printf("NO\n");
      }
    }
  }
}
