#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<pair<int, int>> v;
  vector<vector<int>> adj(101, vector<int>(101, 0));
  for (int i = 0; i < 101; i++) adj[i][i] = 1;
  for (int i = 0; i < n; i++) {
    int x, l, r;
    cin >> x >> l >> r;
    if (x == 1) {
      v.push_back(make_pair(l, r));
      for (int j = 0; j < v.size(); j++) {
        if ((v.back().first < v[j].first && v[j].first < v.back().second) ||
            (v.back().first < v[j].second && v[j].second < v.back().second))
          adj[j][v.size() - 1] = 1;
        if ((v[j].first < v.back().first && v.back().first < v[j].second) ||
            (v[j].first < v.back().second && v.back().second < v[j].second))
          adj[v.size() - 1][j] = 1;
      }
    } else {
      for (int k = 0; k < v.size(); k++)
        for (int j = 0; j < v.size(); j++)
          for (int x = 0; x < v.size(); x++)
            if (adj[j][x] == 0 && adj[j][k] == 1 && adj[k][x] == 1)
              adj[j][x] = 1;
      cout << (adj[l - 1][r - 1] ? "YES\n" : "NO\n");
    }
  }
  return 0;
}
