#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T a) {
  for (auto i = a.begin(); i != a.end(); i++) cout << *i << " ";
  cout << endl;
}
bool isVowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return true;
  return false;
}
void sync() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
vector<long long int> G[1000000];
map<long long int, bool> ck;
bool dfs(long long int a, long long int b) {
  if (a == b) return true;
  ck[a] = true;
  for (long long int j : G[a]) {
    if (ck[j] == true) continue;
    bool d = dfs(j, b);
    if (d == true) return true;
  }
  return false;
}
int main() {
  sync();
  long long int t;
  cin >> t;
  long long int j = 0;
  vector<pair<long long int, long long int> > edges;
  for (long long int testcase = 1; testcase <= t; testcase++) {
    long long int a, b, c;
    cin >> a >> b >> c;
    if (a == 2) {
      b--, c--;
      ck.clear();
      bool d = dfs(b, c);
      if (d == true)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else {
      edges.push_back({b, c});
      if (j == 0) {
      } else {
        for (long long int i = 0; i < j; i++) {
          long long int x1 = edges[i].first;
          long long int y1 = edges[i].second;
          if ((x1 > b && x1 < c) || (y1 > b && y1 < c)) {
            G[i].push_back(j);
          }
          if ((b > x1 && b < y1) || (c > x1 && c < y1)) {
            G[j].push_back(i);
          }
        }
      }
      j++;
    }
  }
}
