Problem: Real Cosmic Communications is the largest telecommunication company on a far far away planet, located at the very edge of the universe. RCC launches communication satellites.

The planet is at the very edge of the universe, so its form is half of a circle. Its radius is r, the ends of its diameter are points A and B. The line AB is the edge of the universe, so one of the half-planes contains nothing, neither the planet, nor RCC satellites, nor anything else. Let us introduce coordinates in the following way: the origin is at the center of AB segment, OX axis coincides with line AB, the planet is completely in y > 0 half-plane.

The satellite can be in any point of the universe, except the planet points. Satellites are never located beyond the edge of the universe, nor on the edge itself — that is, they have coordinate y > 0. Satellite antennas are directed in such way that they cover the angle with the vertex in the satellite, and edges directed to points A and B. Let us call this area the satellite coverage area. 

The picture below shows coordinate system and coverage area of a satellite.

<image>

When RCC was founded there were no satellites around the planet. Since then there have been several events of one of the following types: 

  1. 1 x y — launch the new satellite and put it to the point (x, y). Satellites never move and stay at the point they were launched. Let us assign the number i to the i-th satellite in order of launching, starting from one. 
  2. 2 i — remove satellite number i. 
  3. 3 i j — make an attempt to create a communication channel between satellites i and j. To create a communication channel a repeater is required. It must not be located inside the planet, but can be located at its half-circle border, or above it. Repeater must be in coverage area of both satellites i and j. To avoid signal interference, it must not be located in coverage area of any other satellite. Of course, the repeater must be within the universe, it must have a coordinate y > 0. 



For each attempt to create a communication channel you must find out whether it is possible.

Sample test has the following satellites locations: 

<image>

Input

The first line of input data contains integers r and n — radius of the planet and the number of events (1 ≤ r ≤ 109, 1 ≤ n ≤ 5·105).

Each of the following n lines describe events in the specified format.

Satellite coordinates are integer, the satisfy the following constraints |x| ≤ 109, 0 < y ≤ 109. No two satellites that simultaneously exist can occupy the same point. Distance from each satellite to the center of the planet is strictly greater than r.

It is guaranteed that events of types 2 and 3 only refer to satellites that exist at the moment. For all events of type 3 the inequality i ≠ j is satisfied.

Output

For each event of type 3 print «YES» on a separate line, if it is possible to create a communication channel, or «NO» if it is impossible.

Example

Input

5 8
1 -5 8
1 -4 8
1 -3 8
1 2 7
3 1 3
2 2
3 1 3
3 3 4


Output

NO
YES
YES

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
inline int Read() {
  int x = 0, f = 1, c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 500005;
struct Node {
  int opt, x, y;
} e[MAXN];
int n, m, r, tot, x[MAXN], y[MAXN], p[MAXN], q[MAXN], mx[MAXN << 2], rnk[MAXN],
    pos[MAXN], rot[MAXN];
pair<int, int> a[MAXN], b[MAXN];
inline bool Cmp(pair<int, int> u, pair<int, int> v) {
  return 1LL * u.first * v.second - 1LL * u.second * v.first > 0;
}
inline void Modify(int x, int l, int r, int p, int v) {
  if (l == r) return (void)(mx[x] = v);
  int mid = l + r >> 1;
  if (p <= mid)
    Modify(x << 1, l, mid, p, v);
  else
    Modify(x << 1 | 1, mid + 1, r, p, v);
  mx[x] = max(mx[x << 1], mx[x << 1 | 1]);
}
inline int Query(int x, int l, int r, int ql, int qr) {
  if (l == ql && r == qr) return mx[x];
  int mid = l + r >> 1;
  if (qr <= mid) return Query(x << 1, l, mid, ql, qr);
  if (ql > mid) return Query(x << 1 | 1, mid + 1, r, ql, qr);
  return max(Query(x << 1, l, mid, ql, mid),
             Query(x << 1 | 1, mid + 1, r, mid + 1, qr));
}
int main() {
  r = Read(), m = Read();
  for (int i = 1; i <= m; i++) {
    e[i].opt = Read();
    if (e[i].opt == 1)
      n++, x[n] = e[i].x = Read(), y[n] = e[i].y = Read();
    else if (e[i].opt == 2)
      e[i].x = Read();
    else
      e[i].x = Read(), e[i].y = Read();
  }
  for (int i = 1; i <= n; i++) a[i] = make_pair(x[i] + r, y[i]);
  sort(a + 1, a + n + 1, Cmp);
  for (int i = 1; i <= n; i++)
    p[i] = lower_bound(a + 1, a + n + 1, make_pair(x[i] + r, y[i]), Cmp) - a;
  for (int i = 1; i <= n; i++) b[i] = make_pair(r - x[i], y[i]);
  sort(b + 1, b + n + 1, Cmp);
  for (int i = 1; i <= n; i++)
    q[i] = lower_bound(b + 1, b + n + 1, make_pair(r - x[i], y[i]), Cmp) - b;
  for (int i = 1; i <= n; i++) pos[i] = i;
  sort(pos + 1, pos + n + 1, [&](int x, int y) {
    return make_pair(p[x], q[x]) < make_pair(p[y], q[y]);
  });
  for (int i = 1; i <= n; i++) rnk[pos[i]] = i;
  for (int i = 1, cur = 0; i <= m; i++)
    if (e[i].opt == 1)
      cur++, Modify(1, 1, n, rnk[cur], q[cur]);
    else if (e[i].opt == 2)
      Modify(1, 1, n, rnk[e[i].x], 0);
    else {
      int idx = e[i].x, idy = e[i].y;
      Modify(1, 1, n, rnk[idx], 0);
      Modify(1, 1, n, rnk[idy], 0);
      pair<int, int> x, y;
      if (p[idx] < p[idy])
        x = a[p[idx]];
      else
        x = a[p[idy]];
      if (q[idx] < q[idy])
        y = b[q[idx]];
      else
        y = b[q[idy]];
      if (1LL * x.first * y.first - 1LL * x.second * y.second > 0)
        puts("NO");
      else {
        p[n + 1] = lower_bound(a + 1, a + n + 1, x, Cmp) - a;
        q[n + 1] = lower_bound(b + 1, b + n + 1, y, Cmp) - b;
        int t =
            lower_bound(pos + 1, pos + n + 1, n + 1,
                        [&](int x, int y) {
                          return make_pair(p[x], q[x]) < make_pair(p[y], q[y]);
                        }) -
            pos;
        if (Query(1, 1, n, t, n) >= q[n + 1])
          puts("NO");
        else
          puts("YES");
      }
      Modify(1, 1, n, rnk[idx], q[idx]);
      Modify(1, 1, n, rnk[idy], q[idy]);
    }
}