#include <bits/stdc++.h>
using namespace std;
const int EPS = 1e-6;
const int INF = (int)(INT_MAX - 100);
const long long mod = (int)(1e+9 + 7);
const int N = (int)(100);
vector<int> G[N + 1];
bool vis[N + 1];
bool dfs(int a, int b) {
  vis[a] = 1;
  bool ans = 0;
  for (int va : G[a]) {
    if (vis[va]) continue;
    if (va == b) return 1;
    ans |= dfs(va, b);
  }
  return ans;
}
int main() {
  int q, t;
  cin >> q;
  int x, y;
  vector<pair<int, int> > v;
  for (int z = 0; z < q; z++) {
    scanf("%d", &t), scanf("%d%d", &x, &y);
    if (t == 1) {
      int tam = int(v.size());
      for (int i = 0; i < tam; i++) {
        if ((x < v[i].first && v[i].first < y) ||
            (x < v[i].second && v[i].second < y))
          G[i].push_back(tam);
        if ((v[i].first < x && x < v[i].second) ||
            (v[i].first < y && y < v[i].second))
          G[tam].push_back(i);
      }
      v.push_back({x, y});
      continue;
    }
    memset(vis, 0, sizeof(vis));
    if (dfs(x - 1, y - 1))
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
