#include <bits/stdc++.h>
int a[111], b[111], n = 0, t, x, y, m;
bool f[111];
void dfs(int i) {
  f[i] = true;
  for (int k = 1; k <= n; k++) {
    if (f[k]) continue;
    if (a[i] > a[k] && a[i] < b[k])
      dfs(k);
    else if (b[i] > a[k] && b[i] < b[k])
      dfs(k);
  }
}
int main() {
  scanf("%d", &t);
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(f, 0, sizeof(f));
  while (t--) {
    scanf("%d", &m);
    if (m == 1) {
      n++;
      scanf("%d%d", &a[n], &b[n]);
    } else {
      scanf("%d%d", &x, &y);
      memset(f, 0, sizeof(f));
      dfs(x);
      if (f[y])
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
