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 pt {
  int x, y, id;
  friend pt operator+(const pt& a, const pt& b) {
    return {a.x + b.x, a.y + b.y};
  }
  friend pt operator-(const pt& a, const pt& b) {
    return {a.x - b.x, a.y - b.y};
  }
  friend long long operator*(const pt& a, const pt& b) {
    return 1LL * a.x * b.y - 1LL * a.y * b.x;
  }
  friend long long operator%(const pt& a, const pt& b) {
    return 1LL * a.x * b.x + 1LL * a.y * b.y;
  }
};
struct SegTree {
  int n;
  SegTree() {}
};
const int N = 500005;
int r, n, t[N], x[N], y[N], sz;
pt a[N];
int ps[N];
pt tree[4 * N], lf, rt;
pt up(const pt& a, const pt& b) { return (a - rt) * (b - rt) > 0 ? a : b; }
void build(int v, int tl, int tr) {
  if (tl == tr) {
    tree[v] = lf;
    return;
  }
  int tm = (tl + tr) / 2;
  build(2 * v, tl, tm);
  build(2 * v + 1, tm + 1, tr);
  tree[v] = up(tree[2 * v], tree[2 * v + 1]);
}
pt go(int v, int tl, int tr, int l, int r) {
  if (l > r || l > tr || r < tl) return lf;
  if (l <= tl && r >= tr) return tree[v];
  int tm = (tl + tr) / 2;
  return up(go(2 * v, tl, tm, l, r), go(2 * v + 1, tm + 1, tr, l, r));
}
void update(int v, int tl, int tr, int pos, pt val) {
  if (tl == tr) {
    tree[v] = val;
    return;
  }
  int tm = (tl + tr) / 2;
  if (pos <= tm) {
    update(2 * v, tl, tm, pos, val);
  } else {
    update(2 * v + 1, tm + 1, tr, pos, val);
  }
  tree[v] = up(tree[2 * v], tree[2 * v + 1]);
}
void add(int id) { update(1, 0, sz - 1, ps[id], a[ps[id]]); }
void remove(int id) { update(1, 0, sz - 1, ps[id], lf); }
bool go(int x, int y) {
  pt f = a[ps[x]];
  pt s = a[ps[y]];
  pt lf = {-r, 0};
  pt rt = {+r, 0};
  pt first = (f - lf) * (s - lf) > 0 ? (f - lf) : (s - lf);
  pt second = (f - rt) * (s - rt) < 0 ? (f - rt) : (s - rt);
  if (first % second < 0) return false;
  int l = -1, r = sz;
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (first * (a[m] - lf) < 0)
      l = m;
    else
      r = m;
  }
  remove(x);
  remove(y);
  auto here = go(1, 0, sz - 1, r, sz - 1);
  here = here - rt;
  add(x);
  add(y);
  if (here * second >= 0) return false;
  return true;
}
void solve() {
  cin >> r >> n;
  for (int i = 0; i < (n); ++i) {
    cin >> t[i] >> x[i];
    if (t[i] != 2) cin >> y[i];
    if (t[i] == 1) {
      a[sz] = {x[i], y[i], sz};
      ++sz;
      x[i] = sz;
    }
    --x[i];
    --y[i];
  }
  lf = {-r, 0};
  rt = {+r, 0};
  sort(a, a + sz,
       [](const pt& a, const pt& b) { return (a - lf) * (b - lf) > 0; });
  for (int i = 0; i < (sz); ++i) ps[a[i].id] = i;
  build(1, 0, sz - 1);
  for (int i = 0; i < (n); ++i) {
    if (t[i] == 1) {
      add(x[i]);
    }
    if (t[i] == 2) {
      remove(x[i]);
    }
    if (t[i] == 3) {
      cout << (go(x[i], y[i]) ? "YES" : "NO") << '\n';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  for (int i = 0; i < (t); ++i) solve();
  return 0;
}