#include <bits/stdc++.h>
int take() {
  int n;
  scanf("%d", &n);
  return n;
}
double ttake() {
  double n;
  scanf("%lf", &n);
  return n;
}
long long takes() {
  long long n;
  scanf("%lld", &n);
  return n;
}
int cas;
using namespace std;
bool approximatelyEqual(float a, float b, float epsilon) {
  return fabs(a - b) <= ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool essentiallyEqual(float a, float b, float epsilon) {
  return fabs(a - b) <= ((fabs(a) > fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool definitelyGreaterThan(float a, float b, float epsilon) {
  return (a - b) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool definitelyLessThan(float a, float b, float epsilon) {
  return (b - a) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool nw[105][105];
pair<int, int> arr[105];
int main() {
  int n = take(), k = 1;
  for (int t = 1; t <= n; t += 1) {
    int ty = take();
    if (ty == 2) {
      int u = take(), v = take();
      printf("%s\n", nw[u][v] ? "YES" : "NO");
    } else {
      arr[k].first = take();
      arr[k].second = take();
      for (int i = 1; i <= k - 1; i += 1) {
        int c = arr[i].first, d = arr[i].second;
        int a = arr[k].first, b = arr[k].second;
        if ((c < a && a < d && c < d) or (c < b && b < d && c < d)) {
          nw[k][i] = 1;
        }
        if ((a < c && c < b && a < b) or (a < d && d < b && a < b)) {
          nw[i][k] = 1;
        }
      }
      for (int i = 1; i <= k; i += 1) {
        for (int j = 1; j <= k; j += 1) {
          for (int t = 1; t <= k; t += 1) {
            if (nw[j][i] && nw[i][t]) nw[j][t] = 1;
          }
        }
      }
      k++;
    }
  }
  { return 0; };
}
