#include <bits/stdc++.h>
using namespace std;
vector<int> graph[100];
int found = 0;
int color[100];
void dfs(int u, int a, int n) {
  color[u] = 1;
  for (int i = 0; i < graph[u].size(); i++) {
    int v = graph[u][i];
    if (v == a) {
      found = 1;
    }
    if (color[v] == 0) {
      dfs(v, a, n);
    }
  }
  color[u] = 2;
}
int main() {
  int n;
  cin >> n;
  int x[100], y[100];
  int i = 0;
  while (n--) {
    int com, a, b;
    cin >> com >> a >> b;
    if (com == 1) {
      x[i] = a;
      y[i] = b;
      for (int j = 0; j < i; j++) {
        if ((x[j] < b && x[j] > a) || (y[j] < b && y[j] > a)) {
          graph[j].push_back(i);
        }
        if ((a > x[j] && a < y[j]) || (b > x[j] && b < y[j])) {
          graph[i].push_back(j);
        }
      }
      i++;
    } else {
      found = 0;
      a--;
      b--;
      for (int j = 0; j < i; j++) {
        color[j] = 0;
      }
      dfs(a, b, i);
      if (found) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
}
