#include <bits/stdc++.h>
using namespace std;
struct set {
  int x, y;
} s[50];
int main() {
  int n, a, b, c, l = 1, vis[105];
  scanf("%d", &n);
  while (n--) {
    scanf("%d%d%d", &a, &b, &c);
    bool flag = false;
    if (a == 1) {
      s[l].x = b;
      s[l++].y = c;
    } else {
      memset(vis, 0, sizeof(vis));
      queue<int> q;
      q.push(b);
      vis[b] = 1;
      while (!q.empty()) {
        int now = q.front();
        q.pop();
        if (now == c) {
          flag = true;
          break;
        }
        for (int i = 0; i < l; ++i) {
          if (i != now && vis[i] != 1) {
            if ((s[now].x > s[i].x && s[now].x < s[i].y) ||
                (s[now].y > s[i].x && s[now].y < s[i].y)) {
              q.push(i);
              vis[i] = 1;
            }
          }
        }
      }
      if (flag) {
        cout << "YES\n";
      } else {
        cout << "NO\n";
      }
    }
  }
}
