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>
const int MAXN = 1000010;
struct vec {
  long long x, y;
  vec() { x = y = 0; }
  vec(long long a, long long b) { x = a, y = b; }
  long long operator^(vec b) const { return x * b.y - y * b.x; }
  long long operator*(vec b) const { return x * b.x + y * b.y; }
  long long norm2() const { return x * x + y * y; }
  long double norm() const { return sqrt(x * x + y * y); }
  vec operator-(vec b) const { return vec(x - b.x, y - b.y); }
  vec operator+(vec b) const { return vec(x + b.x, y + b.y); }
  vec operator*(long double k) const { return vec(x * k, y * k); }
  friend bool operator<(const vec& a, const vec& b) { return (a ^ b) > 0; }
  friend std::istream& operator>>(std::istream& in, vec& x) {
    in >> x.x >> x.y;
    return in;
  }
  friend std::ostream& operator<<(std::ostream& out, vec x) {
    out << '(' << x.x << ',' << x.y << ')';
    return out;
  }
};
int bel[MAXN], lll[MAXN], rrr[MAXN];
int discr(std::vector<std::pair<vec, int> > v, int* tar) {
  const int L = v.size();
  std::sort(v.begin(), v.end());
  int rnk = 0;
  for (int i = 0; i != L; ++i) {
    if (i != 0 && !(v[i].first < v[i - 1].first || v[i - 1].first < v[i].first))
      ;
    else
      ++rnk;
    bel[tar[v[i].second] = i + 1] = rnk;
    if (!lll[rnk]) lll[rnk] = i + 1;
    rrr[rnk] = i + 1;
  }
  return L;
}
vec ps[MAXN];
int opt[MAXN], xs[MAXN], ys[MAXN];
const int NINF = 0xcfcfcfcf;
int tree[MAXN << 2];
void add(int u, int l, int r, int tar, int v) {
  if (l == r) return (void)(tree[u] = v);
  int mid = l + r >> 1;
  if (tar <= mid)
    add(u << 1, l, mid, tar, v);
  else
    add(u << 1 | 1, mid + 1, r, tar, v);
  tree[u] = std::max(tree[u << 1], tree[u << 1 | 1]);
}
int qry(int u, int l, int r, int L, int R) {
  if (L <= l && r <= R) return tree[u];
  int mid = l + r >> 1, res = NINF;
  if (L <= mid) res = qry(u << 1, l, mid, L, R);
  if (mid < R) res = std::max(res, qry(u << 1 | 1, mid + 1, r, L, R));
  return res;
}
int n;
inline int tr(int x, int y) { return x == 1 ? y : NINF; }
int nl;
void add(int i, int v) { add(1, 1, nl, ys[i], tr(v, xs[i])); }
long long R;
bool incir(vec x, vec y) { return (x * y) < 0 || (x ^ y) <= 0; }
int trans[MAXN];
int main() {
  memset(tree, 0xcf, sizeof tree);
  std::ios_base::sync_with_stdio(false), std::cin.tie(0);
  std::cin >> R >> n;
  vec pol(-R, 0), por(R, 0);
  std::vector<std::pair<vec, int> > ll;
  for (int i = 1, bak = 0; i <= n; ++i) {
    std::cin >> opt[i] >> xs[i];
    if (opt[i] != 2) std::cin >> ys[i];
    if (opt[i] == 1) {
      ps[i] = vec(xs[i], ys[i]);
      ll.emplace_back(ps[i] - pol, i);
      ll.emplace_back(ps[i] - por, i + n);
      trans[++bak] = i;
    } else
      xs[i] = trans[xs[i]], ys[i] = trans[ys[i]];
  }
  static int ls[MAXN << 1], app[MAXN];
  nl = discr(ll, ls);
  for (int i = 1; i <= n; ++i)
    if (opt[i] == 1) xs[i] = ls[i], ys[i] = ls[i + n];
  for (int T = 1; T <= n; ++T) {
    if (opt[T] == 1)
      add(T, 1), app[T] = true;
    else if (opt[T] == 2)
      add(xs[T], -1), app[xs[T]] = false;
    else {
      bool can = true;
      int A = xs[T], B = ys[T];
      if (!incir(std::min(ps[A] - pol, ps[B] - pol),
                 std::max(ps[A] - por, ps[B] - por))) {
        int l = lll[bel[std::min(xs[A], xs[B])]];
        int r = rrr[bel[std::max(ys[A], ys[B])]];
        if (app[A]) add(A, -1);
        if (app[B]) add(B, -1);
        can = qry(1, 1, nl, 1, r) >= l;
        if (app[A]) add(A, 1);
        if (app[B]) add(B, 1);
      }
      std::cout << (can ? "NO" : "YES") << '\n';
    }
  }
  return 0;
}