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 = (int)1e9 + 7;
const int MOD2 = 1007681537;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
inline int chkmin(T& a, const T& val) {
  return val < a ? a = val, 1 : 0;
}
template <class T>
inline int chkmax(T& a, const T& val) {
  return a < val ? a = val, 1 : 0;
}
inline long long isqrt(long long k) {
  long long r = sqrt(k) + 1;
  while (r * r > k) r--;
  return r;
}
inline long long icbrt(long long k) {
  long long r = cbrt(k) + 1;
  while (r * r * r > k) r--;
  return r;
}
inline void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
inline void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
inline int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(long double x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(long double x, long double y) { return sign(x - y); }
const int maxn = 5e5 + 5;
int n, d, k;
int op[maxn];
int x[maxn];
int y[maxn];
int z[maxn];
int l[maxn];
int r[maxn];
int a[maxn];
int b[maxn];
long long ff1(int i, int j) {
  int x1 = x[i] + d;
  int y1 = y[i] + 0;
  int x2 = x[j] + d;
  int y2 = y[j] + 0;
  return (long long)x1 * y2 - (long long)x2 * y1;
}
long long ff2(int i, int j) {
  int x1 = x[i] - d;
  int y1 = y[i] - 0;
  int x2 = x[j] - d;
  int y2 = y[j] - 0;
  return (long long)x1 * y2 - (long long)x2 * y1;
}
int cmp1(int i, int j) {
  long long cr = ff1(i, j);
  if (cr) return cr > 0;
  return i < j;
}
int cmp2(int i, int j) {
  long long cr = ff2(i, j);
  if (cr) return cr > 0;
  return i < j;
}
set<int> heap[maxn];
int st[maxn << 1];
void upd(int p, int n, int val) {
  for (st[p += n] = val; p > 1;)
    p >>= 1, st[p] = min(st[p << 1], st[p << 1 | 1]);
}
int query(int l, int r, int n) {
  int res = INF;
  for (l += n, r += n + 1; l < r; l >>= 1, r >>= 1) {
    if (l & 1) chkmin(res, st[l++]);
    if (r & 1) chkmin(res, st[--r]);
  }
  return res;
}
void upd(int u, int n) {
  int val = int((heap[u]).size()) ? *heap[u].begin() : INF;
  upd(u, n, val);
}
long long dot(pair<int, int> a, pair<int, int> b) {
  return (long long)a.first * b.first + (long long)a.second * b.second;
}
void solve() {
  cin >> d >> n;
  for (int i = (0); i < (n); i++) {
    cin >> op[i];
    if (op[i] == 1) {
      cin >> x[k] >> y[k], k++;
    } else if (op[i] == 2) {
      cin >> z[i], z[i]--;
    } else {
      cin >> l[i] >> r[i], l[i]--, r[i]--;
    }
  }
  vector<int> ver;
  for (int i = (0); i < (k); i++) ver.push_back(i);
  sort((ver).begin(), (ver).end(), cmp1);
  int st1 = 0;
  for (int i = (0); i < (k); i++) {
    if (i && ff1(ver[i - 1], ver[i])) st1++;
    a[ver[i]] = st1;
  }
  for (int i = (0); i < (k); i++) a[i] = st1 - a[i];
  int st2 = 0;
  sort((ver).begin(), (ver).end(), cmp2);
  for (int i = (0); i < (k); i++) {
    if (i && ff2(ver[i - 1], ver[i])) st2++;
    b[ver[i]] = st2;
  }
  for (int i = (0); i < (k + k); i++) st[i] = INF;
  k = 0;
  for (int i = (0); i < (n); i++) {
    if (op[i] == 1) {
      heap[a[k]].insert(b[k]);
      upd(a[k], st1 + 1);
      k++;
    } else if (op[i] == 2) {
      int ix = z[i];
      heap[a[ix]].erase(b[ix]);
      upd(a[ix], st1 + 1);
    } else {
      int ix1 = l[i];
      int ix2 = r[i];
      int u = max(a[ix1], a[ix2]);
      int v = max(b[ix1], b[ix2]);
      pair<int, int> p, q;
      if (a[ix1] > a[ix2]) {
        p = make_pair(x[ix1] + d, y[ix1]);
      } else {
        p = make_pair(x[ix2] + d, y[ix2]);
      }
      if (b[ix1] > b[ix2]) {
        q = make_pair(x[ix1] - d, y[ix1]);
      } else {
        q = make_pair(x[ix2] - d, y[ix2]);
      }
      heap[a[ix1]].erase(b[ix1]);
      upd(a[ix1], st1 + 1);
      heap[a[ix2]].erase(b[ix2]);
      upd(a[ix2], st1 + 1);
      if (dot(p, q) < 0 || query(0, u, st1 + 1) <= v) {
        cout << "NO\n";
      } else {
        cout << "YES\n";
      }
      heap[a[ix1]].insert(b[ix1]);
      upd(a[ix1], st1 + 1);
      heap[a[ix2]].insert(b[ix2]);
      upd(a[ix2], st1 + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  solve();
  return 0;
}