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;
struct point {
  long long x, y;
  int num;
  bool operator<(const point &p) const { return x * p.y < p.x * y; }
} A[510000], B[510000];
long long Mul(point a, point b) { return a.x * b.x + a.y * b.y; }
int R, n, cnt;
struct AA {
  int b, e, num;
  bool operator<(const AA &p) const { return b != p.b ? b < p.b : e < p.e; }
} w[510000];
int ReNum[510000];
struct QQ {
  int ck, a, b;
} Q[510000];
int IT[(1 << 19) + (1 << 19)];
void Ins(int a) {
  a = ReNum[a];
  int y = w[a].e;
  a += (1 << 19);
  IT[a] = y;
  while (a != 1) {
    a >>= 1;
    IT[a] = max(IT[a + a], IT[a + a + 1]);
  }
}
void Del(int a) {
  a = ReNum[a];
  a += (1 << 19);
  IT[a] = 0;
  while (a != 1) {
    a >>= 1;
    IT[a] = max(IT[a + a], IT[a + a + 1]);
  }
}
int Max(int b, int e) {
  int r = 0;
  b += (1 << 19), e += (1 << 19);
  while (b <= e) {
    r = max(r, max(IT[b], IT[e]));
    b = (b + 1) >> 1;
    e = (e - 1) >> 1;
  }
  return r;
}
bool Valid(int a, int b) {
  point t1 = A[a], t2 = A[b];
  if (Mul(A[a], B[b]) < 0) return false;
  return true;
}
int main() {
  int i, ck, x, y;
  scanf("%d%d", &R, &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &ck);
    if (ck == 1) {
      scanf("%d%d", &x, &y);
      cnt++;
      Q[i] = {1, cnt, 0};
      A[cnt] = {x + R, y, cnt};
      B[cnt] = {x - R, y, cnt};
    } else if (ck == 2) {
      scanf("%d", &x);
      Q[i] = {2, x, 0};
    } else {
      scanf("%d%d", &x, &y);
      Q[i] = {3, x, y};
    }
  }
  sort(A + 1, A + cnt + 1);
  sort(B + 1, B + cnt + 1);
  int pv1 = 1, pv2 = 1;
  for (i = 1; i <= cnt; i++) {
    if (A[pv1] < A[i]) pv1 = i;
    if (B[pv2] < B[i]) pv2 = i;
    w[A[i].num].b = pv1;
    w[B[i].num].e = pv2;
    w[i].num = i;
  }
  sort(w + 1, w + cnt + 1);
  for (i = 1; i <= cnt; i++) ReNum[w[i].num] = i;
  for (i = 1; i <= n; i++) {
    if (Q[i].ck == 1) {
      Ins(Q[i].a);
    }
    if (Q[i].ck == 2) {
      Del(Q[i].a);
    }
    if (Q[i].ck == 3) {
      Del(Q[i].a), Del(Q[i].b);
      int a = ReNum[Q[i].a], b = ReNum[Q[i].b];
      int aa = max(w[a].b, w[b].b), bb = min(w[a].e, w[b].e);
      if (!Valid(aa, bb)) {
        printf("NO\n");
      } else {
        AA tp = {aa + 1, 0, 0};
        int t = lower_bound(w + 1, w + cnt + 1, tp) - w - 1;
        if (Max(1, t) >= bb) {
          printf("NO\n");
        } else
          printf("YES\n");
      }
      Ins(Q[i].a), Ins(Q[i].b);
    }
  }
}