#include <bits/stdc++.h>
using namespace std;
template <class A>
inline bool Max(A &a, const A &b) {
  return a < b ? a = b, true : false;
}
template <class A>
inline bool Min(A &a, const A &b) {
  return b < a ? a = b, true : false;
}
template <class A, class B>
ostream &operator<<(ostream &out, const pair<A, B> &p) {
  return out << '[' << p.first << ',' << p.second << ']';
}
template <class A>
ostream &operator<<(ostream &out, const vector<A> &v) {
  typename vector<A>::const_iterator it = v.begin(), end = v.end();
  if (it == end) return out << "[]";
  out << '[' << *it;
  while (++it != end) {
    out << ',' << *it;
  }
  return out << ']';
}
template <class A>
ostream &operator<<(ostream &out, const set<A> &st) {
  typename set<A>::const_iterator it = st.begin(), end = st.end();
  if (it == end) return out << "[]";
  out << '[' << *it;
  while (++it != end) {
    out << ',' << *it;
  }
  return out << ']';
}
bool gg(const char *s) {
  int i = 0;
  while (true) {
    if (s[i] != '1') return false;
    ++i;
    if (s[i] == '4') ++i;
    if (s[i] == '4') ++i;
    if (!s[i]) return true;
  }
}
char tmp[65535];
bool gg(int n) {
  sprintf(tmp, "%d", n);
  return gg(tmp);
}
bool reaches[120];
bool canreach(const pair<int, int> &a, const pair<int, int> &b) {
  return b.first < a.first && a.first < b.second ||
         b.first < a.second && a.second < b.second;
}
void dfs(const vector<pair<int, int> > &v, int now) {
  if (reaches[now]) return;
  reaches[now] = true;
  const pair<int, int> &tt = v[now];
  for (int i = 0; i < v.size(); ++i) {
    if (i == now) continue;
    if (canreach(tt, v[i])) dfs(v, i);
  }
}
bool canreach(const vector<pair<int, int> > &v, int s, int e) {
  memset(reaches, 0, sizeof reaches);
  dfs(v, s);
  return reaches[e];
}
int main(int argc, char **argv) {
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > v;
  while (n--) {
    int ch, x, y;
    scanf("%d%d%d", &ch, &x, &y);
    if (ch == 1) {
      v.push_back(make_pair(x, y));
    } else if (ch == 2) {
      puts(canreach(v, x - 1, y - 1) ? "YES" : "NO");
      assert(x != y);
    } else {
      assert(false);
    }
  }
  return EXIT_SUCCESS;
}
