#include <bits/stdc++.h>
using namespace std;
const long long int infinity = 9e18;
bool dfs(int a, int b, vector<vector<int>> &v, bitset<100> &visited) {
  visited[a] = 1;
  for (auto i : v[a]) {
    if (!visited[i]) {
      if ((i == b) || dfs(i, b, v, visited)) return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a, b, c;
  vector<pair<int, int>> vp;
  vector<vector<int>> v(100);
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c;
    if (a == 1) {
      vp.push_back({b, c});
      for (int i = 0; i < vp.size() - 1; i++) {
        if (((vp[i].first < b) && (b < vp[i].second)) ||
            ((vp[i].first < c) && (c < vp[i].second))) {
          v[vp.size() - 1].push_back(i);
        }
        if (((vp[i].first > b) && (vp[i].first < c)) ||
            ((vp[i].second > b) && (c > vp[i].second))) {
          v[i].push_back(vp.size() - 1);
        }
      }
    } else {
      b--, c--;
      bitset<100> visited;
      if (dfs(b, c, v, visited)) {
        cout << "YES";
      } else {
        cout << "NO";
      }
      cout << "\n";
    }
  }
  return 0;
}
