#include <bits/stdc++.h>
using namespace std;
const int MAX = 100;
vector<int> g[MAX];
bool visited[MAX];
void dfs(int u) {
  visited[u] = true;
  for (int i = 0; i < g[u].size(); i++)
    if (!visited[g[u][i]]) {
      visited[g[u][i]] = true;
      dfs(g[u][i]);
    }
}
bool reachable(int u, int v) {
  memset(visited, 0, sizeof(bool) * MAX);
  dfs(u);
  return visited[v];
}
int main() {
  int64_t s[MAX], e[MAX];
  int n, i, j, l = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    int q, a, b;
    cin >> q >> a >> b;
    if (q == 1) {
      s[l] = a;
      e[l] = b;
      for (j = 0; j < l; j++) {
        if ((s[j] < s[l] && s[l] < e[j]) || (s[j] < e[l] && e[l] < e[j])) {
          g[l].push_back(j);
        }
        if ((s[l] < s[j] && s[j] < e[l]) || (s[l] < e[j] && e[j] < e[l])) {
          g[j].push_back(l);
        }
      }
      l++;
    } else {
      if (reachable(a - 1, b - 1))
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
