#include <bits/stdc++.h>
using namespace std;
deque<int> st, ed;
vector<vector<int> > g;
int icode, i1, i2, n, len;
int memo[101];
bool dfs(int nd) {
  cerr << "visiting node " << nd << "...\n";
  if (memo[nd] != -1) {
    return false;
  }
  if (nd == i2) {
    return true;
  } else {
    memo[nd] = 1;
    bool result = false;
    for (unsigned i = 1; i < st.size(); i = i + 1) {
      bool incident = (st[i] < st[nd] && st[nd] < ed[i]) ||
                      (st[i] < ed[nd] && ed[nd] < ed[i]);
      if (incident) {
        result = dfs(i);
        if (result == true) {
          return result;
        }
      }
    }
    return false;
  }
}
void search() {
  memset(memo, -1, sizeof(memo));
  bool isPossible = dfs(i1);
  string s = isPossible ? "YES" : "NO";
  cout << s << endl;
}
int main() {
  cin >> n;
  st.push_back(INT_MIN);
  ed.push_back(INT_MAX);
  while (n--) {
    cin >> icode >> i1 >> i2;
    if (icode == 1) {
      st.push_back(i1);
      ed.push_back(i2);
    } else {
      assert(icode == 2);
      search();
    }
  }
}
