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 mod = 998244353;
const int MAXN = 500005;
struct seg {
  multiset<int> tree[1050000];
  int val[1050000];
  int lim;
  void init(int n) {
    for (lim = 1; lim <= n; lim <<= 1)
      ;
  }
  void insert(int x, int y) {
    x += lim;
    tree[x].insert(y);
    val[x] = *--tree[x].end();
    while (x > 1) {
      x >>= 1;
      val[x] = max(val[2 * x], val[2 * x + 1]);
    }
  }
  void erase(int x, int y) {
    x += lim;
    tree[x].erase(tree[x].find(y));
    if (tree[x].empty())
      val[x] = 0;
    else
      val[x] = *--tree[x].end();
    while (x > 1) {
      x >>= 1;
      val[x] = max(val[2 * x], val[2 * x + 1]);
    }
  }
  int query(int s, int e) {
    s += lim;
    e += lim;
    int ret = 0;
    while (s < e) {
      if (s % 2 == 1) ret = max(ret, val[s++]);
      if (e % 2 == 0) ret = max(ret, val[e--]);
      s >>= 1;
      e >>= 1;
    }
    if (s == e) ret = max(ret, val[s]);
    return ret;
  }
} seg;
int r, n;
int qt[MAXN], qi[MAXN], qj[MAXN];
int vx[MAXN], vy[MAXN];
pair<int, int> a[MAXN];
long long ccw(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  int dx1 = b.first - a.first;
  int dy1 = b.second - a.second;
  int dx2 = c.first - a.first;
  int dy2 = c.second - a.second;
  return 1ll * dx1 * dy2 - 1ll * dy1 * dx2;
}
long long dot(pair<int, int> a, pair<int, int> b) {
  return 1ll * a.first * b.first + 1ll * a.second * b.second;
}
bool cross(pair<int, int> a, pair<int, int> b) {
  a.first += r;
  b.first -= r;
  return dot(a, b) < 0;
}
void solve() {
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (qt[i] == 1) {
      cnt++;
      seg.insert(vx[cnt], vy[cnt]);
    }
    if (qt[i] == 2) {
      int p = qi[i];
      seg.erase(vx[p], vy[p]);
    }
    if (qt[i] == 3) {
      int x = qi[i], y = qj[i];
      if (vx[x] > vx[y]) swap(x, y);
      if (cross(a[x], a[y]))
        puts("NO");
      else {
        int px = min(vx[x], vx[y]);
        int py = min(vy[x], vy[y]);
        bool ok = 1;
        seg.erase(vx[x], vy[x]);
        seg.erase(vx[y], vy[y]);
        if (seg.query(px, MAXN - 1) >= py)
          puts("NO");
        else
          puts("YES");
        seg.insert(vx[x], vy[x]);
        seg.insert(vx[y], vy[y]);
      }
    }
  }
}
struct point {
  pair<int, int> x;
  int idx;
};
vector<point> v;
int main() {
  scanf("%d %d", &r, &n);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &qt[i]);
    if (qt[i] != 2)
      scanf("%d %d", &qi[i], &qj[i]);
    else
      scanf("%d", &qi[i]);
    if (qt[i] == 1) {
      a[++cnt] = pair<int, int>(qi[i], qj[i]);
    }
  }
  for (int i = 1; i <= cnt; i++) v.push_back({a[i], i});
  sort(v.begin(), v.end(), [&](const point &a, const point &b) {
    return ccw(pair<int, int>(-r, 0), a.x, b.x) > 0;
  });
  for (int i = 0; i < v.size();) {
    int e = i;
    while (e < v.size() && ccw(pair<int, int>(-r, 0), v[i].x, v[e].x) == 0) e++;
    for (int j = i; j < e; j++) vx[v[j].idx] = i + 1;
    i = e;
  }
  sort(v.begin(), v.end(), [&](const point &a, const point &b) {
    return ccw(pair<int, int>(r, 0), a.x, b.x) < 0;
  });
  for (int i = 0; i < v.size();) {
    int e = i;
    while (e < v.size() && ccw(pair<int, int>(r, 0), v[i].x, v[e].x) == 0) e++;
    for (int j = i; j < e; j++) vy[v[j].idx] = i + 1;
    i = e;
  }
  seg.init(MAXN);
  solve();
}