#include <bits/stdc++.h>
using namespace std;
pair<int, int> aa[100];
int i, j, n, arr[1000][1000], t, m, a, b;
void FLW(int size) {
  for (int qq = 1; qq <= size; qq++)
    for (int ii = 1; ii <= size; ii++)
      for (int jj = 1; jj <= size; jj++)
        if ((arr[ii][qq] == 1) && (arr[qq][jj] == 1)) arr[ii][jj] = 1;
}
int main() {
  cin >> n;
  m = 0;
  for (i = 0; i < n; i++) {
    cin >> t;
    if (t == 1) {
      m++;
      cin >> aa[m].first >> aa[m].second;
      for (j = 1; j < m; j++) {
        if ((aa[m].first < aa[j].second) && (aa[m].first > aa[j].first) &&
            (aa[m].second > aa[j].second)) {
          arr[m][j] = 1;
          arr[j][m] = 1;
        }
        if ((aa[m].second < aa[j].second) && (aa[m].second > aa[j].first) &&
            (aa[m].first < aa[j].first)) {
          arr[m][j] = 1;
          arr[j][m] = 1;
        }
        if ((aa[m].first > aa[j].first) && (aa[m].first < aa[j].second) &&
            (aa[m].second >= aa[j].first) && (aa[m].second <= aa[j].second))
          arr[m][j] = 1;
        if ((aa[m].first >= aa[j].first) && (aa[m].first <= aa[j].second) &&
            (aa[m].second > aa[j].first) && (aa[m].second < aa[j].second))
          arr[m][j] = 1;
        if ((aa[j].first >= aa[m].first) && (aa[j].first <= aa[m].second) &&
            (aa[j].second > aa[m].first) && (aa[j].second < aa[m].second))
          arr[j][m] = 1;
        if ((aa[j].first > aa[m].first) && (aa[j].first < aa[m].second) &&
            (aa[j].second >= aa[m].first) && (aa[j].second <= aa[m].second))
          arr[j][m] = 1;
      }
    }
    if (t == 2) {
      FLW(m);
      cin >> a >> b;
      if (arr[a][b] == 1)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
}
