#include <bits/stdc++.h>
using namespace std;
const int MAX = 105;
int N;
vector<pair<int, int> > I;
bool mark[MAX];
void go(int v) {
  if (mark[v]) return;
  mark[v] = true;
  for (int w = 0; w < (int)I.size(); w++)
    if ((I[w].first < I[v].first && I[v].first < I[w].second) ||
        (I[w].first < I[v].second && I[v].second < I[w].second))
      go(w);
}
int main() {
  cin >> N;
  while (N--) {
    int typ;
    cin >> typ;
    if (typ == 1) {
      int x, y;
      cin >> x >> y;
      I.push_back(pair<int, int>(x, y));
    } else {
      int a, b;
      cin >> a >> b;
      a--, b--;
      memset(mark, 0, sizeof mark);
      go(a);
      if (mark[b])
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
  return 0;
}
