#include <bits/stdc++.h>
using namespace std;
int n, sz, x[101], y[101], id, a, b;
bool dp[101];
void dfs(int v) {
  dp[v] = 1;
  for (int i = 0; i < sz; i++)
    if (!dp[i])
      if ((x[i] < x[v] && x[v] < y[i]) || (x[i] < y[v] && y[v] < y[i])) dfs(i);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> id >> a >> b;
    if (id == 1)
      x[sz] = a, y[sz] = b, sz++;
    else {
      a--;
      b--;
      memset(dp, 0, sizeof(dp));
      dfs(a);
      if (dp[b])
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
