#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> u;
bool vis[101] = {0};
bool dfs(int a, int b) {
  if (a == b) return 1;
  if (vis[a]) return false;
  vis[a] = true;
  bool ans = false;
  for (int i = 0; i < u[a].size(); i++) {
    ans = ans || dfs(u[a][i], b);
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  int t, x, y, c = 0;
  vector<pair<int, int>> v;
  while (n--) {
    cin >> t >> x >> y;
    t = 2 - t;
    if (t) {
      v.push_back(make_pair(x, y));
      u.push_back(vector<int>());
      for (int i = 0; i < c; i++) {
        int a = v[i].first, b = v[i].second;
        if ((a < y && a > x) || (b < y && b > x)) u[i].push_back(c);
        if ((x < b && x > a) || (y < b && y > a)) u[c].push_back(i);
      }
      c++;
    } else {
      x--;
      y--;
      memset(vis, 0, sizeof(vis));
      puts(dfs(x, y) ? "YES" : "NO");
    }
  }
  return 0;
}
