#include <bits/stdc++.h>
using namespace std;
const long long MXN = 100 + 10;
const long long MXM = 5e2 + 10;
const long long MX5 = 2e5 + 10;
const long long MX6 = 1e6 + 10;
const long long INF = 8e18;
const long double eps = 1e-9;
const long long MOD = 1e9 + 7;
long long power(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * power(a * a % md, b / 2, md) % md
                      : power(a * a % md, b / 2, md) % md));
}
long long bmm(long long a, long long b) {
  return (a % b == 0 ? b : bmm(b, a % b));
}
string base2(long long n) {
  string a = "";
  while (n >= 2) {
    a += (char)(n % 2 + '0');
    n /= 2;
  }
  a += (char)(n + '0');
  reverse((a).begin(), (a).end());
  return a;
}
long long n, m, ans = 0, k, now, x[MXN], y[MXN], a, b, t = 0;
vector<long long> G[MXN];
bool vis[MXN];
void DFS(long long u) {
  vis[u] = 1;
  for (auto v : G[u]) {
    if (!vis[v]) DFS(v);
  }
  return;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> k;
    if (k == 1) {
      cin >> x[t] >> y[t];
      for (int j = t - 1; j >= 0; j--) {
        if ((x[j] < x[t] && x[t] < y[j]) || (x[j] < y[t] && y[t] < y[j])) {
          G[t].push_back(j);
        }
        if ((x[t] < x[j] && x[j] < y[t]) || (x[t] < y[j] && y[j] < y[t])) {
          G[j].push_back(t);
        }
      }
      t++;
    } else {
      cin >> a >> b;
      a--;
      b--;
      fill(vis, vis + MXN, 0);
      DFS(a);
      if (vis[b]) {
        cout << "YES" << '\n';
      } else {
        cout << "NO" << '\n';
      }
    }
  }
  return 0;
}
