#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626;
const long long int MAX = 1000000000 + 7;
const int INF = 0x3f3f3f3f;
std::vector<pair<int, pair<int, int> > > vi;
bool ok[120];
bool flag;
bool canpass(pair<int, pair<int, int> > a, pair<int, pair<int, int> > b) {
  int s1 = a.second.first;
  int e1 = a.second.second;
  int s2 = b.second.first;
  int e2 = b.second.second;
  if ((s2 < s1 && s1 < e2) || (s2 < e1 && e1 < e2)) return true;
  return false;
}
void dfs(int x, int y) {
  if (ok[x] or flag) return;
  if (x == y) {
    flag = 1;
    return;
  }
  ok[x] = 1;
  for (int i = 0; i < vi.size(); i++) {
    if (canpass(vi[x], vi[i])) dfs(i, y);
  }
}
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d", &n);
  int st = -1;
  for (int i = 0; i < n; i++) {
    int t, a, b;
    cin >> t >> a >> b;
    if (t == 1) {
      st++;
      vi.push_back(make_pair(st, pair<int, int>(a, b)));
    } else {
      flag = 0;
      memset(ok, 0, sizeof(ok));
      dfs(a - 1, b - 1);
      if (flag)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
