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;
const int N = 500100;
struct C {
  int x, y;
  C(int x = 0, int y = 0) : x(x), y(y) {}
  long long operator*(const C& a) const {
    return (long long)x * a.x + (long long)y * a.y;
  }
  long long operator/(const C& a) const {
    return (long long)x * a.y - (long long)y * a.x;
  }
  C conj() const { return C(x, -y); }
  bool operator+(const C& a) const {
    long long u = *this * a.conj(), v = *this / a.conj();
    return !u || !v || ((u > 0) ^ (v > 0));
  }
  bool operator<(const C& a) const { return *this / a < 0; }
  bool operator!=(const C& a) const { return *this < a || a < *this; }
  bool operator==(const C& a) const { return !(*this != a); }
};
int mx[N * 4], q1, q2, q3;
void mdf(int o, int l, int r) {
  if (l == r) {
    mx[o] = q2;
    return;
  }
  int mid = (l + r) / 2;
  if (q1 <= mid)
    mdf(o * 2, l, mid);
  else
    mdf(o * 2 + 1, mid + 1, r);
  mx[o] = max(mx[o * 2], mx[o * 2 + 1]);
}
void qry(int o, int l, int r) {
  if (q1 <= l && r <= q2) {
    q3 = max(q3, mx[o]);
    return;
  }
  int mid = (l + r) / 2;
  if (q1 <= mid) qry(o * 2, l, mid);
  if (q2 > mid) qry(o * 2 + 1, mid + 1, r);
}
int R, q, opt[N], u[N], v[N], w[N], cnt, id[N], fi[N];
pair<C, C> a[N];
C f[N], g[N];
pair<pair<int, int>, int> b[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> R >> q;
  for (int i = 1; i <= q; ++i) {
    cin >> opt[i] >> u[i];
    if (opt[i] != 2) cin >> v[i];
    if (opt[i] == 1) {
      w[i] = ++cnt;
      a[cnt] =
          make_pair(f[cnt] = C(-u[i] - R, v[i]), g[cnt] = C(u[i] - R, v[i]));
    }
  }
  sort(f + 1, f + cnt + 1);
  sort(g + 1, g + cnt + 1);
  int cntl = unique(f + 1, f + cnt + 1) - f - 1,
      cntr = unique(g + 1, g + cnt + 1) - g - 1;
  for (int i = 1; i <= cnt; ++i)
    b[i] =
        make_pair(make_pair(lower_bound(f + 1, f + cntl + 1, a[i].first) - f,
                            lower_bound(g + 1, g + cntr + 1, a[i].second) - g),
                  i);
  sort(b + 1, b + cnt + 1);
  for (int i = cnt; i; --i) id[b[i].second] = i, fi[b[i].first.first] = i;
  for (int i = 1; i <= q; ++i)
    if (opt[i] == 1) {
      q1 = id[w[i]];
      q2 = b[q1].first.second;
      mdf(1, 1, cnt);
    } else if (opt[i] == 2) {
      q1 = id[u[i]];
      q2 = 0;
      mdf(1, 1, cnt);
    } else {
      int x = id[u[i]], y = id[v[i]],
          l = min(b[x].first.first, b[y].first.first),
          r = min(b[x].first.second, b[y].first.second);
      if (x > y) swap(x, y);
      if (f[l] + g[r]) {
        int ql = fi[l], qr = cnt;
        q3 = 0;
        q1 = ql;
        q2 = x - 1;
        if (q1 <= q2) qry(1, 1, cnt);
        q1 = x + 1;
        q2 = y - 1;
        if (q1 <= q2) qry(1, 1, cnt);
        q1 = y + 1;
        q2 = qr;
        if (q1 <= q2) qry(1, 1, cnt);
        if (q3 < r)
          cout << "YES\n";
        else
          cout << "NO\n";
      } else
        cout << "NO\n";
    }
  return 0;
}