#include <bits/stdc++.h>
using namespace std;
void addEdge(vector<vector<int>> adj, int u, int v) {
  adj[u].push_back(v);
  adj[v].push_back(u);
}
int found = 0;
void checkConnection(int a, int b, vector<vector<int>> cam,
                     vector<bool> &visited) {
  visited[a] = true;
  if (a == b) {
    found++;
  }
  if (found == 0) {
    for (int i = 0; i < cam[a].size(); i++) {
      if (found == 0 && visited[cam[a][i]] == false) {
        checkConnection(cam[a][i], b, cam, visited);
      }
    }
  }
}
int main() {
  int n, a, b, c;
  cin >> n;
  vector<vector<int>> cam;
  vector<pair<int, int>> inter;
  int ai = 0;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c;
    if (a == 1) {
      vector<int> temp;
      inter.push_back(make_pair(b, c));
      cam.push_back(temp);
      for (int j = 0; j < ai; j++) {
        if ((inter[j].first < c && inter[j].second > c) ||
            (inter[j].first < b && inter[j].second > b)) {
          cam[ai].push_back(j);
        }
        if ((b < inter[j].first && inter[j].first < c) ||
            (b < inter[j].second && inter[j].second < c)) {
          cam[j].push_back(ai);
        }
      }
      ai++;
    } else {
      b -= 1;
      c -= 1;
      vector<bool> visited(n, false);
      checkConnection(b, c, cam, visited);
      if (found != 0) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
      found = 0;
    }
  }
  return 0;
}
