#include <bits/stdc++.h>
using namespace std;
void gt(int &a, int b) {
  if (a < b) a = b;
}
string n2s(int a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string getKey(int v, int h) { return n2s(v) + "-" + n2s(h); }
int d[200][200], a[200], b[200];
int main() {
  int q, n = 0;
  cin >> q;
  while (q--) {
    int t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      a[n] = x, b[n] = y;
      n++;
      memset(d, sizeof(d), 0);
      for (int i = 0; i <= n - 1; i++)
        for (int j = 0; j <= n - 1; j++)
          if ((a[j] < a[i] && a[i] < b[j]) || (a[j] < b[i] && b[i] < b[j]))
            d[i][j] = 1;
      for (int k = 0; k <= n - 1; k++)
        for (int i = 0; i <= n - 1; i++)
          for (int j = 0; j <= n - 1; j++)
            d[i][j] = d[i][j] || (d[i][k] && d[k][j]);
    } else {
      x--, y--;
      if (d[x][y])
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
