#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long temp = n;
  vector<pair<long long, long long>> v;
  while (temp--) {
    long long c, s, e;
    cin >> c >> s >> e;
    if (c == 1) {
      v.push_back(make_pair(s, e));
    } else {
      unordered_map<long long, vector<long long>> seen;
      for (long long i = 0; i < v.size(); i++) {
        long long a = v[i].first, b = v[i].second;
        for (long long j = i + 1; j < v.size(); j++) {
          long long c = v[j].first, d = v[j].second;
          if ((c < a && a < d) || (c < b && b < d)) {
            seen[i].push_back(j);
          }
          if ((a < c && c < b) || (a < d && d < b)) {
            seen[j].push_back(i);
          }
        }
      }
      long long l = v.size();
      bool visited[l];
      for (long long i = 0; i < l; i++) {
        visited[i] = false;
      }
      s = s - 1;
      e = e - 1;
      queue<long long> q;
      q.push(s);
      bool p = false;
      while (!q.empty()) {
        long long f = q.front();
        if (f == e) {
          p = true;
          break;
        }
        q.pop();
        visited[f] = true;
        for (long long j = 0; j < seen[f].size(); j++) {
          if (!visited[seen[f][j]]) {
            q.push(seen[f][j]);
          }
        }
      }
      if (p) {
        cout << "YES" << '\n';
      } else {
        cout << "NO" << '\n';
      }
    }
  }
  return 0;
}
