#include <bits/stdc++.h>
using namespace std;
const int N = 500, M = 2e5 + 5, INFi = 1e9 + 123, MOD = 1e9 + 7, KEY = 1001;
const long long INFl = 1e18 + 123;
const double EPS = 0.00000001, INFd = 1e18 + 1234.9;
template <typename T>
inline T sqr(T t) {
  return t * t;
}
inline void file() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int n, m, k, type, l, r;
pair<int, int> a[N];
bool used[N];
inline bool bfs(int st, int fn) {
  queue<int> q;
  memset(used, false, sizeof(used));
  q.push(st);
  used[st] = true;
  while (!q.empty()) {
    int pos = q.front();
    if (pos == fn) return true;
    q.pop();
    for (int i = 1; i <= k; i++)
      if (!used[i] &&
          ((a[pos].first > a[i].first && a[pos].first < a[i].second) ||
           (a[pos].second > a[i].first && a[pos].second < a[i].second))) {
        used[i] = true;
        q.push(i);
      }
  }
  return false;
}
int main() {
  file();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> type >> l >> r;
    if (type == 1)
      a[++k] = make_pair(l, r);
    else {
      if (bfs(l, r))
        cout << "YES";
      else
        cout << "NO";
      cout << "\n";
    }
  }
}
