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>
template <typename T>
bool ckmax(T& a, const T& b) {
  return b > a ? a = b, 1 : 0;
}
template <typename T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
using ll = long long;
const int MN = 5e5 + 10;
const int INF = -0xc0c0c0c0;
struct vec {
 public:
  int x, y;
  vec(int _x = 0, int _y = 0) : x(_x), y(_y) {}
  vec& operator-=(const vec& o) {
    x -= o.x, y -= o.y;
    return *this;
  }
  vec& operator+=(const vec& o) {
    x += o.x, y += o.y;
    return *this;
  }
  friend vec operator+(vec a, const vec& b) { return a += b; }
  friend vec operator-(vec a, const vec& b) { return a -= b; }
  ll operator/(const vec& o) const { return (ll)x * o.y - (ll)y * o.x; }
  bool operator<(const vec& o) const { return *this / o < 0; }
  bool operator>(const vec& o) const { return *this / o > 0; }
};
struct Qry {
 public:
  int t, a, b;
  void in() {
    scanf("%d%d", &t, &a);
    if (t == 1 || t == 3) scanf("%d", &b);
  }
} q[MN];
using PID = std::pair<vec, int>;
struct ST {
 public:
  int v[MN * 4];
  ST() { memset(v, 0xc0, sizeof v); }
  void upd(int n, int l, int r, int q, int nv) {
    if (r - l > 1) {
      int m = l + (r - l) / 2;
      if (q < m)
        upd(n << 1, l, m, q, nv);
      else
        upd(n << 1 | 1, m, r, q, nv);
      v[n] = std::max(v[n << 1], v[n << 1 | 1]);
    } else
      v[n] = nv;
  }
  int qry(int n, int l, int r, int ql, int qr) {
    if (ql <= l && r <= qr)
      return v[n];
    else {
      int m = l + (r - l) / 2, f = -INF;
      if (ql < m) ckmax(f, qry(n << 1, l, m, ql, qr));
      if (m < qr) ckmax(f, qry(n << 1 | 1, m, r, ql, qr));
      return f;
    }
  }
};
ST st;
int R, N, M, a[MN], b[MN], am[MN], bm[MN];
std::vector<PID> lb, rb;
bool bad(int a, int b) {
  vec l = std::max(lb[a - 1].first, lb[b - 1].first);
  vec r = std::min(rb[a - 1].first, rb[b - 1].first);
  return vec{l.y, -l.x} < r;
}
int main() {
  scanf("%d%d", &R, &N);
  for (int i = 0; i < N; ++i) {
    q[i].in();
    if (q[i].t == 1) {
      lb.push_back({{q[i].a + R, q[i].b}, M});
      rb.push_back({{q[i].a - R, q[i].b}, M});
      ++M;
    }
  }
  std::sort(lb.begin(), lb.end(), std::greater<PID>());
  std::sort(rb.begin(), rb.end());
  for (int i = 0, j; i < lb.size(); ++i) {
    if (!i || lb[i - 1].first > lb[i].first) j = i;
    a[lb[i].second] = i;
    am[lb[i].second] = j;
  }
  for (int i = 0, j; i < rb.size(); ++i) {
    if (!i || rb[i - 1].first < rb[i].first) j = i;
    b[rb[i].second] = i;
    bm[rb[i].second] = j;
  }
  for (int i = 0; i < M; ++i)
    while (i != lb[i].second) std::swap(lb[i], lb[lb[i].second]);
  for (int i = 0; i < M; ++i)
    while (i != rb[i].second) std::swap(rb[i], rb[rb[i].second]);
  for (int i = 0, j = 0; i < N; ++i)
    if (q[i].t == 1) {
      st.upd(1, 0, M, a[j], b[j]);
      ++j;
    } else if (q[i].t == 2) {
      st.upd(1, 0, M, a[q[i].a - 1], -INF);
    } else if (q[i].t == 3) {
      st.upd(1, 0, M, a[q[i].a - 1], -INF);
      st.upd(1, 0, M, a[q[i].b - 1], -INF);
      if (st.qry(1, 0, M, std::min(am[q[i].a - 1], am[q[i].b - 1]), M) <
              std::min(bm[q[i].a - 1], bm[q[i].b - 1]) &&
          !bad(q[i].a, q[i].b))
        printf("YES\n");
      else
        printf("NO\n");
      st.upd(1, 0, M, a[q[i].a - 1], b[q[i].a - 1]);
      st.upd(1, 0, M, a[q[i].b - 1], b[q[i].b - 1]);
    }
  return 0;
}