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;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
struct Frac {
  long long x, y;
  int z;
  Frac() {}
  Frac(long long x, long long y, int z) : x(x), y(y), z(z) {}
  bool operator<(const Frac &o) const {
    return z || (o.z == 0 && (x * o.y < y * o.x));
  }
  friend bool operator==(const Frac &r1, const Frac &r2) {
    return r1.x * r2.y == r1.y * r2.x;
  }
};
int R;
Frac lt[500105], rt[500105], mp[500105];
int sateCnt;
struct mb {
  int t, x, y, id;
  void rd() {
    scanf("%d", &t);
    if (t == 2)
      scanf("%d", &id);
    else
      scanf("%d%d", &x, &y);
  }
} q[500105];
int li[500105], cnt;
const int MN = (1 << 21) + 5;
struct mbt {
  int M;
  Frac T[MN];
  void init(int sz) {
    for (M = 1; sz + 2 > M; M <<= 1)
      ;
    for (int(i) = 0; (i) < (int)(MN); (i)++) T[i] = {0, 0, 1};
  }
  void uptSingleMax(int l, Frac val) {
    l += M;
    T[l] = val;
    while (l > 1) {
      T[l >> 1] = max(T[l], T[l ^ 1]);
      l >>= 1;
    }
  }
  Frac qyRangeMax(int l, int r) {
    Frac ans = {0, 0, 1};
    for (l = l + M - 1, r = r + M + 1; l ^ r ^ 1; l >>= 1, r >>= 1) {
      if (~l & 1) ans = max(ans, T[l ^ 1]);
      if (r & 1) ans = max(ans, T[r ^ 1]);
    }
    return ans;
  }
} T;
bool del[500105];
priority_queue<pair<Frac, int>> Q[500105];
void add(int staId) {
  del[staId] = 0;
  int k = li[staId];
  Q[k].push({rt[staId], staId});
  T.uptSingleMax(k, Q[k].top().first);
}
void rmv(int staId) {
  del[staId] = 1;
  int k = li[staId];
  while (del[Q[k].top().second]) {
    Q[k].pop();
  }
  T.uptSingleMax(k, Q[k].top().first);
}
void fmain(int tid) {
  scanf("%d%d", &R, &n);
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    q[i].rd();
    if (q[i].t == 1) {
      int x = q[i].x, y = q[i].y;
      sateCnt++;
      lt[sateCnt] = Frac(x + R, y, 0);
      rt[sateCnt] = Frac(y, R - x, 0);
      q[i].id = sateCnt;
    }
  }
  for (int(i) = 1; (i) <= (int)(sateCnt); (i)++) {
    mp[i] = (lt[i]);
  }
  sort(mp + 1, mp + 1 + sateCnt);
  cnt = unique(mp + 1, mp + 1 + sateCnt) - mp - 1;
  for (int(i) = 1; (i) <= (int)(sateCnt); (i)++) {
    li[i] = lower_bound(mp + 1, mp + cnt + 1, lt[i]) - mp;
  }
  T.init(cnt);
  for (int(i) = 1; (i) <= (int)(cnt); (i)++) Q[i].push({Frac(0, 0, 1), 0});
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    if (q[i].t == 1) {
      add(q[i].id);
    } else if (q[i].t == 2) {
      rmv(q[i].id);
    } else {
      int x = q[i].x, y = q[i].y;
      if (lt[y] < lt[x]) swap(x, y);
      bool ok = 0;
      if (rt[x] < lt[y]) {
        puts("NO");
        continue;
      }
      int idx = li[y];
      rmv(x);
      rmv(y);
      ok = T.qyRangeMax(1, idx) < min(rt[x], rt[y]);
      add(x);
      add(y);
      puts(ok ? "YES" : "NO");
    }
  }
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}