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>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse3,sse4,popcnt,avx,mmx,abm,tune=native")
using namespace std;
namespace output {
void __(short x) { cout << x; }
void __(unsigned x) { cout << x; }
void __(int x) { cout << x; }
void __(long long x) { cout << x; }
void __(unsigned long long x) { cout << x; }
void __(double x) { cout << x; }
void __(long double x) { cout << x; }
void __(char x) { cout << x; }
void __(const char* x) { cout << x; }
void __(const string& x) { cout << x; }
void __(bool x) { cout << (x ? "true" : "false"); }
template <class S, class T>
void __(const pair<S, T>& x) {
  __(1 ? "(" : ""), __(x.first), __(1 ? ", " : " "), __(x.second),
      __(1 ? ")" : "");
}
template <class T>
void __(const vector<T>& x) {
  __(1 ? "{" : "");
  bool _ = 0;
  for (const auto& v : x) __(_ ? 1 ? ", " : " " : ""), __(v), _ = 1;
  __(1 ? "}" : "");
}
template <class T>
void __(const set<T>& x) {
  __(1 ? "{" : "");
  bool _ = 0;
  for (const auto& v : x) __(_ ? 1 ? ", " : " " : ""), __(v), _ = 1;
  __(1 ? "}" : "");
}
template <class T>
void __(const multiset<T>& x) {
  __(1 ? "{" : "");
  bool _ = 0;
  for (const auto& v : x) __(_ ? 1 ? ", " : " " : ""), __(v), _ = 1;
  __(1 ? "}" : "");
}
template <class S, class T>
void __(const map<S, T>& x) {
  __(1 ? "{" : "");
  bool _ = 0;
  for (const auto& v : x) __(_ ? 1 ? ", " : " " : ""), __(v), _ = 1;
  __(1 ? "}" : "");
}
void pr() { cout << "\n"; }
template <class S, class... T>
void pr(const S& a, const T&... b) {
  __(a);
  if (sizeof...(b)) __(' ');
  pr(b...);
}
}  // namespace output
using namespace output;
const int MN = 5e5 + 5;
const long double PI = (long double)4 * atan((long double)1),
                  eps = (long double)5e-19;
int N, R, i, j, x, y, cnt, nxt;
long double st[3 * MN];
map<long double, int> mp;
set<long double> pnt[MN];
long double aa[MN], bb[MN];
pair<int, int> pos[MN];
struct qur {
  int t, x, y;
} q[MN];
long long dot(pair<int, int> i, pair<int, int> j) {
  return 1LL * i.first * j.first + 1LL * i.second * j.second;
}
bool ok(int i, int j) {
  pair<int, int> v1, v2;
  if (aa[i] < aa[j])
    v1 = {pos[i].first + R, pos[i].second};
  else
    v1 = {pos[j].first + R, pos[j].second};
  if (bb[i] < bb[j])
    v2 = {pos[i].first - R, pos[i].second};
  else
    v2 = {pos[j].first - R, pos[j].second};
  return dot(v1, v2) >= 0;
}
void upd(int i, int s, int e, int ind, long double val, bool del = 0) {
  if (s != e) {
    if ((s + e) / 2 < ind)
      upd(2 * i + 1, (s + e) / 2 + 1, e, ind, val, del);
    else
      upd(2 * i, s, (s + e) / 2, ind, val, del);
    st[i] = max(st[2 * i], st[2 * i + 1]);
  } else {
    if (del)
      pnt[s].erase(val);
    else
      pnt[s].insert(val);
    if (pnt[s].empty())
      st[i] = -1;
    else {
      auto it = pnt[s].end();
      it--;
      st[i] = *it;
    }
  }
}
long double qu(int i, int s, int e, int ss, int se) {
  if (s >= ss && e <= se)
    return st[i];
  else if ((s + e) / 2 < ss)
    return qu(2 * i + 1, (s + e) / 2 + 1, e, ss, se);
  else if ((s + e) / 2 >= se)
    return qu(2 * i, s, (s + e) / 2, ss, se);
  else
    return max(qu(2 * i, s, (s + e) / 2, ss, se),
               qu(2 * i + 1, (s + e) / 2 + 1, e, ss, se));
}
int main() {
  scanf("%d%d", &R, &N);
  for (i = 1; i <= N; i++) {
    scanf("%d%d", &q[i].t, &q[i].x);
    if (q[i].t == 1) {
      cnt++;
      scanf("%d", &q[i].y);
      pos[cnt] = {q[i].x, q[i].y};
      aa[cnt] =
          (long double)atan2((long double)q[i].y, (long double)q[i].x + R);
      bb[cnt] =
          PI - (long double)atan2((long double)q[i].y, (long double)q[i].x - R);
      mp[aa[cnt]] = 0;
    } else if (q[i].t == 3)
      scanf("%d", &q[i].y);
  }
  for (auto it = mp.begin(); it != mp.end(); it++) it->second = ++nxt;
  cnt = 0;
  for (i = 1; i <= N; i++) {
    if (q[i].t == 1) {
      cnt++;
      upd(1, 1, nxt, mp[aa[cnt]], bb[cnt], 0);
    } else if (q[i].t == 2) {
      upd(1, 1, nxt, mp[aa[q[i].x]], bb[q[i].x], 1);
    } else {
      x = q[i].x, y = q[i].y;
      if (!ok(x, y))
        printf("NO\n");
      else {
        long double ix = min(aa[x], aa[y]);
        long double iy = min(bb[x], bb[y]);
        int inx = mp[ix];
        upd(1, 1, nxt, mp[aa[x]], bb[x], 1);
        upd(1, 1, nxt, mp[aa[y]], bb[y], 1);
        if (qu(1, 1, nxt, inx, nxt) >= iy)
          printf("NO\n");
        else
          printf("YES\n");
        upd(1, 1, nxt, mp[aa[x]], bb[x], 0);
        upd(1, 1, nxt, mp[aa[y]], bb[y], 0);
      }
    }
  }
  return 0;
}