#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, a, b, c;
  static int arr[101];
  map<int, pair<int, int>> mp;
  pair<int, int> start;
  pair<int, int> end;
  cin >> q;
  int counter = 0;
  while (q--) {
    cin >> a >> b >> c;
    if (a == 1) {
      counter++;
      mp.insert({counter, {b, c}});
    } else {
      if (!mp.empty()) {
        queue<pair<int, int>> holder;
        holder.push(mp.at(b));
        arr[b] = q + 1;
        end = mp.at(c);
        bool flag = false;
        while (!holder.empty() && !flag) {
          start = holder.front();
          holder.pop();
          for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
            if ((start.first > itr->second.first &&
                 start.first < itr->second.second) ||
                (start.second > itr->second.first &&
                 start.second < itr->second.second)) {
              if (arr[itr->first] != q + 1) {
                holder.push({itr->second.first, itr->second.second});
                arr[itr->first] = q + 1;
                if (itr->second.first == end.first &&
                    itr->second.second == end.second) {
                  cout << "YES" << endl;
                  flag = true;
                  break;
                }
              }
            }
          }
        }
        if (!flag) {
          cout << "NO" << endl;
        }
      } else {
        cout << "NO" << endl;
        continue;
      }
    }
  }
  return 0;
}
