Problem: Once a walrus professor Plato asked his programming students to perform the following practical task. 

The students had to implement such a data structure that would support a convex hull on some set of points S. The input to the program had q queries of two types: 

1. Add a point with coordinates (x, y) into the set S. Note that in this case the convex hull of S could have changed, and could have remained the same. 

2. Say whether a point with coordinates (x, y) belongs to an area limited by the convex hull, including the border. 

All the students coped with the task. What about you?

Input

The first line contains an integer q (4 ≤ q ≤ 105). 

Then follow q lines in the following way: "t x y", where t is the query type (1 or 2), and (x, y) are the coordinates of the point ( - 106 ≤ x, y ≤ 106, x and y are integers). 

There is at least one query of type 2.

It is guaranteed that the three queries of the first type follow first and the points given in the queries form a non-degenerative triangle. Also all the points added in S are distinct.

Output

For each query of the second type print one string containing "YES", if the point lies inside the convex hull or on its border. Otherwise, print "NO".

Examples

Input

8
1 0 0
1 2 0
1 2 2
2 1 0
1 0 2
2 1 1
2 2 1
2 20 -1


Output

YES
YES
YES
NO

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int eps = 1e-8;
long long n, d;
struct vec {
  int x, y;
  double ang;
  vec() {}
  vec(int X, int Y, double ANG) { x = X, y = Y, ang = ANG; }
  vec operator+(vec a) { return vec(x + a.x, y + a.y, ang); }
  vec operator-(vec a) { return vec(x - a.x, y - a.y, ang); }
  vec operator*(int a) { return vec(x * a, y * a, ang); }
  bool operator<(const vec &a) const {
    return ang == a.ang ? x < a.x : ang < a.ang;
  }
  friend long long cross(vec x, vec y) {
    return 1ll * x.x * y.y - 1ll * x.y * y.x;
  }
  friend int slope(vec x, vec y) { return (x.y - y.y) / (x.x - y.x); }
  friend long long cal1(vec x, vec y, vec k) { return cross(y - x, k - y); }
  friend long long cal2(vec x, vec y, vec k) { return cross(y - x, k - x); }
  friend int dot(vec x, vec y) { return x.x * y.x + x.y * y.y; }
  friend int dis(vec x, vec y) {
    return (x.x - y.x) * (x.x - y.x) + (x.y - y.y) * (x.y - y.y);
  }
};
inline int read() {
  int s = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) f = ch == '-' ? -1 : 1, ch = getchar();
  while (isdigit(ch)) s = s * 10 + ch - '0', ch = getchar();
  return s * f;
}
set<vec> S;
set<vec>::iterator getp(set<vec>::iterator x) {
  return x == S.begin() ? --S.end() : --x;
}
set<vec>::iterator getn(set<vec>::iterator x) {
  return ++x == S.end() ? S.begin() : x;
}
set<vec>::iterator pre, nxt;
void ins(vec x) {
  if (cal1(*pre, x, *nxt) <= 0) return;
  S.insert(x);
  set<vec>::iterator tmp = S.find(x);
  set<vec>::iterator i = getp(tmp), j = getp(i);
  while (cal2(*j, *tmp, *i) >= 0) S.erase(i), i = j, j = getp(j);
  i = getn(tmp), j = getn(i);
  while (cal2(*j, *tmp, *i) <= 0) S.erase(i), i = j, j = getn(j);
}
int X[4], Y[4];
int main() {
  int n = read();
  int tx = 0, ty = 0;
  for (int i = 1; i <= n; i++) {
    int op = read(), x = read(), y = read();
    if (i <= 3) tx += x, ty += y, X[i] = x * 3, Y[i] = y * 3;
    x *= 3, y *= 3;
    if (i <= 3) {
      if (i == 3)
        for (int j = 1; j <= 3; j++)
          S.insert(vec(X[j], Y[j], atan2(Y[j] - ty, X[j] - tx)));
      continue;
    }
    vec tmp = vec(x, y, atan2(y - ty, x - tx));
    nxt = S.lower_bound(tmp);
    if (nxt == S.end()) nxt = S.begin();
    pre = getp(nxt);
    if (op == 1)
      ins(tmp);
    else if (cal1(*pre, tmp, *nxt) <= 0)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}