#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const double PI = 2 * acos(0);
struct node {
  int x, y;
};
int main(void) {
  std::ios_base::sync_with_stdio(false);
  node list[101];
  bool neigh[101][101], visited[101];
  int q, n, x, a, b;
  for (auto i = 0; i < 101; ++i)
    for (auto j = 0; j < 101; ++j) neigh[i][j] = false;
  n = 0;
  cin >> q;
  while (q--) {
    cin >> x >> a >> b;
    if (x == 1) {
      ++n;
      list[n].x = a;
      list[n].y = b;
      for (auto i = 1; i <= n - 1; ++i) {
        if ((list[i].x < a && a < list[i].y) ||
            (list[i].x < b && b < list[i].y))
          neigh[n][i] = true;
        if ((a < list[i].x && list[i].x < b) ||
            (a < list[i].y && list[i].y < b))
          neigh[i][n] = true;
      }
    } else {
      fill(visited, visited + 101, false);
      bool p = false;
      queue<int> list;
      visited[a] = true;
      list.push(a);
      while (!list.empty() && !p) {
        x = list.front();
        list.pop();
        for (auto i = 1; i <= n; ++i) {
          if (neigh[x][i] && i == b) {
            p = true;
            break;
          }
          if (neigh[x][i] && !visited[i]) {
            visited[i] = true;
            list.push(i);
          }
        }
      }
      if (p)
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
  return 0;
}
