#include <bits/stdc++.h>
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int exp(long long int x, long long int y) {
  long long int res = 1;
  x = x % 1000000007;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
using namespace std;
long long int N;
pair<long long int, long long int> v[101];
vector<long long int> vis(101);
long long int check(long long int x, long long int y) {
  if (v[y].first < v[x].first && v[x].first < v[y].second) return 1;
  if (v[y].first < v[x].second && v[x].second < v[y].second) return 1;
  return 0;
}
void dfs(long long int x) {
  if (vis[x]) return;
  vis[x] = 1;
  for (long long int i = 1; i <= N; i++) {
    if (check(x, i)) dfs(i);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t, x, a, b;
  cin >> t;
  N = 0;
  for (long long int i = 0; i < t; i++) {
    cin >> x >> a >> b;
    if (x == 1) {
      N++;
      v[N] = make_pair(a, b);
    } else {
      for (long long int j = 0; j < 101; j++) vis[j] = 0;
      dfs(a);
      if (vis[b])
        cout << "YES";
      else
        cout << "NO";
      cout << endl;
    }
  }
  return 0;
}
