#include <bits/stdc++.h>
using namespace std;
bool isEdge(const pair<int, int>& x, const pair<int, int>& y) {
  return ((y.first < x.first && x.first < y.second) ||
          (y.first < x.second && x.second < y.second));
}
void addInt(vector<vector<int> >& adj_list,
            vector<pair<int, int> >& intervals) {
  for (int i = 0; i < intervals.size() - 1; i++) {
    if (isEdge(intervals[i], intervals[intervals.size() - 1])) {
      adj_list[i].push_back(intervals.size() - 1);
    }
    if (isEdge(intervals[intervals.size() - 1], intervals[i])) {
      adj_list[intervals.size() - 1].push_back(i);
    }
  }
}
bool query(const vector<vector<int> > adj_list, bool visited[], int node,
           int source, int dest) {
  bool ret = false;
  if (visited[node]) return false;
  visited[node] = true;
  if (node == dest) {
    return true;
  }
  for (int i = 0; i < adj_list[node].size(); i++) {
    ret = max(ret, query(adj_list, visited, adj_list[node][i], source, dest));
  }
  return ret;
}
int main() {
  vector<vector<int> > adj_list(100);
  vector<pair<int, int> > intervals;
  int n;
  cin >> n;
  int op, a, b;
  for (int i = 0; i < n; i++) {
    cin >> op >> a >> b;
    if (op == 1) {
      intervals.push_back(make_pair(a, b));
      addInt(adj_list, intervals);
    } else {
      bool visited[100];
      memset(visited, false, sizeof(visited));
      if (query(adj_list, visited, a - 1, a - 1, b - 1))
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
