#include <bits/stdc++.h>
using namespace std;
const long long MaxN = 110;
bool visited[MaxN];
pair<long long, long long> inter[MaxN];
vector<long long> G[MaxN];
long long cnt = 0;
void dfs(long long v) {
  visited[v] = 1;
  for (auto u : G[v])
    if (!visited[u]) dfs(u);
}
int32_t main() {
  long long n;
  cin >> n;
  long long indx = 1;
  for (long long i = 1; i <= n; i++) {
    long long q, x, y;
    cin >> q >> x >> y;
    if (q == 1) {
      inter[indx].first = x, inter[indx].second = y;
      for (long long j = 1; j < indx; j++) {
        if ((inter[indx].first < inter[j].second &&
             inter[indx].first > inter[j].first) ||
            (inter[indx].second < inter[j].second &&
             inter[indx].second > inter[j].first))
          G[indx].push_back(j);
        if ((inter[j].first < inter[indx].second &&
             inter[j].first > inter[indx].first) ||
            (inter[j].second < inter[indx].second &&
             inter[j].second > inter[indx].first))
          G[j].push_back(indx);
      }
      indx++;
    } else {
      bool ok = 0;
      dfs(x);
      if (visited[x] && visited[y]) ok = 1;
      cout << (ok ? "YES\n" : "NO\n");
      for (long long j = 0; j < MaxN; j++) visited[j] = 0;
    }
  }
  return 0;
}
