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 = 5e5 + 7;
int cnt;
struct frac {
  int x, y;
};
frac X[N], Y[N];
bool operator<(const frac &a, const frac &b) {
  return 1LL * a.x * b.y > 1LL * a.y * b.x;
}
bool operator==(const frac &a, const frac &b) { return !(a < b || b < a); }
struct event {
  bool is_modify;
  int id;
  frac x, y;
};
bool operator<(const event &a, const event &b) {
  if (!(a.y == b.y)) return b.y < a.y;
  return a.is_modify > b.is_modify;
}
vector<event> all;
int ans[N], Tree[N], tick[N], xxx, n;
int &tree(int x) {
  if (tick[x] < xxx) {
    tick[x] = xxx;
    Tree[x] = 0;
  }
  return Tree[x];
}
void add(int x, int c) {
  while (x <= n) {
    tree(x) += c;
    x += x & -x;
  }
}
int query(int x) {
  int res = 0;
  while (x) {
    res += tree(x);
    x -= x & -x;
  }
  return res;
}
void divide_time(int l, int r) {
  if (l >= r) return;
  int mid = (l + r) / 2;
  divide_time(l, mid);
  divide_time(mid + 1, r);
  vector<event> bll;
  vector<frac> ax;
  for (int i = l; i <= mid; ++i) {
    if (all[i].is_modify) {
      bll.push_back(all[i]);
      ax.push_back(all[i].x);
    }
  }
  for (int i = mid + 1; i <= r; ++i) {
    if (!all[i].is_modify) {
      bll.push_back(all[i]);
      ax.push_back(all[i].x);
    }
  }
  sort(bll.begin(), bll.end());
  sort(ax.begin(), ax.end());
  ax.erase(unique(ax.begin(), ax.end()), ax.end());
  xxx++;
  ::n = ax.size();
  for (auto e : bll) {
    int x = lower_bound(ax.begin(), ax.end(), e.x) - ax.begin() + 1;
    if (e.is_modify) {
      int c = (e.id > 0 ? 1 : -1);
      add(n - x + 1, c);
    } else {
      ans[e.id] += query(n - x + 1);
    }
  }
}
bool debug = 0;
bool inside(frac a, frac b) { return 1LL * a.x * b.x + 1LL * a.y * b.y < 0; }
int main() {
  int R, m, n = 0;
  if (debug)
    R = 1000, m = 50000;
  else
    scanf("%d%d", &R, &m);
  for (int r = 0; r < m; ++r) {
    int type;
    if (debug)
      type = (cnt == 0 ? 1 : rand() % 2 * 2 + 1);
    else
      scanf("%d", &type);
    if (type == 1) {
      ++cnt;
      int x, y;
      if (debug) {
        x = rand() % 20000 - 10000;
        y = rand() % 10000;
        while (1LL * x * x + 1LL * y * y <= 1LL * R * R) {
          x = rand() % 20000 - 10000;
          y = rand() % 10000;
        }
      } else
        scanf("%d%d", &x, &y);
      X[cnt] = (frac){x + R, y};
      Y[cnt] = (frac){R - x, y};
      all.push_back((event){1, cnt, X[cnt], Y[cnt]});
    } else if (type == 2) {
      int x;
      scanf("%d", &x);
      all.push_back((event){1, -x, X[x], Y[x]});
    } else {
      int x, y;
      if (debug) {
        x = rand() % cnt + 1;
        y = rand() % cnt + 1;
      } else
        scanf("%d%d", &x, &y);
      all.push_back((event){0, n++, min(X[x], X[y]), min(Y[x], Y[y])});
      auto tmp = all.back().y;
      tmp.x = -tmp.x;
      if (inside(all.back().x, tmp)) ans[n - 1] = 3;
    }
  }
  divide_time(0, (int)all.size() - 1);
  for (int i = 0; i < n; ++i) puts(ans[i] <= 2 ? "YES" : "NO");
}