#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T _sq(T a) {
  return a * a;
}
template <class T>
inline T _sqrt(T a) {
  return (T)sqrt((double)a);
}
template <class T, class X>
inline T _pow(T a, X y) {
  T z = 1;
  for (int i = 1; i <= y; i++) {
    z *= a;
  }
  return z;
}
template <class T>
inline T _gcd(T a, T b) {
  a = abs(a);
  b = abs(b);
  if (!b) return a;
  return _gcd(b, a % b);
}
template <class T>
inline T _lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / _gcd(a, b)) * b;
}
template <class T>
inline T _extended(T a, T b, T &x, T &y) {
  a = abs(a);
  b = abs(b);
  T g, x1, y1;
  if (!b) {
    x = 1;
    y = 0;
    g = a;
    return g;
  }
  g = _extended(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return g;
}
template <class T, class X>
inline bool getbit(T a, X i) {
  T t = 1;
  return ((a & (t << i)) > 0);
}
template <class T, class X>
inline T setbit(T a, X i) {
  T t = 1;
  return (a | (t << i));
}
template <class T, class X>
inline T resetbit(T a, X i) {
  T t = 1;
  return (a & (~(t << i)));
}
template <class T, class X>
inline T togglebit(T a, X i) {
  T t = 1;
  return (a ^ (t << i));
}
template <class T, class X>
inline T _bigmod(T n, X m) {
  unsigned long long ret = 1, a = n % 1000000007;
  while (m) {
    if (m & 1) ret = (ret * a) % 1000000007;
    m >>= 1;
    a = (a * a) % 1000000007;
  }
  ret %= 1000000007;
  return (T)ret;
}
template <class T>
inline T _modinv(T n) {
  return _bigmod(n, 1000000007 - 2);
}
template <class T>
void pv(T v) {
  int vl = v.size();
  for (int i = 0; i <= vl - 1; i++) cout << v[i] << " ";
  cout << endl;
}
int n, q, x[(100 + 3)], y[(100 + 3)];
bool vis[(100 + 3)];
int dfs(int s, int d) {
  if (s == d) return 1;
  vis[s] = 1;
  int ret = 0;
  for (int i = 0; i <= n - 1; i++) {
    if (((x[i] < x[s] && x[s] < y[i]) || (x[i] < y[s] && y[s] < y[i])) &&
        !vis[i]) {
      vis[i] = 1;
      ret |= dfs(i, d);
    }
    if (ret) break;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> q;
  int a, x1, y1;
  n = 0;
  while (q--) {
    cin >> a >> x1 >> y1;
    if (a == 1) {
      x[n] = x1;
      y[n] = y1;
      n++;
    } else {
      memset(vis, 0, sizeof vis);
      if (dfs(x1 - 1, y1 - 1))
        puts("YES");
      else
        puts("NO");
    }
  }
  return 0;
}
