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;
long long mod = 1000000007LL;
long long base = 10000007;
long long large = 1000000000000000000LL;
struct Vector {
  long long x, y;
  Vector(long long x = 0, long long y = 0) : x(x), y(y){};
  void init(long long _x, long long _y) {
    x = _x;
    y = _y;
  }
  void print() { cout << x << " " << y << endl; }
};
Vector operator+(Vector A, Vector B) { return Vector(A.x + B.x, A.y + B.y); }
Vector operator-(Vector A, Vector B) { return Vector(A.x - B.x, A.y - B.y); }
long long cross(Vector &a, Vector &b) { return a.x * b.y - a.y * b.x; }
long long dot(Vector &a, Vector &b) { return a.x * b.x + a.y * b.y; }
bool operator<(Vector a, Vector b) { return cross(a, b) > 0LL; }
vector<Vector> mini;
int up;
Vector val;
void update(int o, int l, int r) {
  if (l == r) {
    mini[o] = val;
  } else {
    int m = (l + r) / 2;
    if (up <= m) update(o * 2, l, m);
    if (up > m) update(o * 2 + 1, m + 1, r);
    mini[o] = min(mini[o * 2], mini[o * 2 + 1]);
  }
}
int ql, qr;
Vector re;
void query(int o, int l, int r) {
  if (ql <= l && qr >= r) {
    re = min(re, mini[o]);
  } else {
    int m = (l + r) / 2;
    if (ql <= m) query(o * 2, l, m);
    if (qr > m) query(o * 2 + 1, m + 1, r);
  }
}
int main() {
  int n;
  long long r;
  cin >> r >> n;
  Vector left = Vector(-r, 0);
  Vector right = Vector(r, 0);
  vector<Vector> lp(n, Vector());
  vector<Vector> rp = lp;
  int sz = 0;
  vector<pair<int, pair<int, int> > > q;
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      long long x, y;
      scanf("%I64d%I64d", &x, &y);
      Vector p(x, y);
      lp[sz] = p - left;
      rp[sz] = p - right;
      q.push_back(pair<int, pair<int, int> >(t, pair<int, int>(sz, -1)));
      sz++;
    }
    if (t == 2) {
      int x;
      scanf("%d", &x);
      x--;
      q.push_back(pair<int, pair<int, int> >(t, pair<int, int>(x, -1)));
    }
    if (t == 3) {
      int x, y;
      scanf("%d%d", &x, &y);
      x--;
      y--;
      q.push_back(pair<int, pair<int, int> >(t, pair<int, int>(x, y)));
    }
  }
  n = sz;
  vector<pair<Vector, int> > e;
  for (int i = 0; i < n; i++) {
    e.push_back(pair<Vector, int>(lp[i], i));
  }
  sort(e.begin(), e.end());
  vector<Vector> b;
  for (int i = 0; i < n; i++) {
    b.push_back(e[i].first);
  }
  vector<int> pos(n, -1);
  for (int i = 0; i < n; i++) {
    pos[e[i].second] = i;
  }
  mini.assign(4 * n + 10, left);
  for (int i = 0; i < (int)q.size(); i++) {
    int t = q[i].first;
    if (t == 1) {
      int x = q[i].second.first;
      val = rp[x];
      up = pos[x];
      update(1, 0, n - 1);
    }
    if (t == 2) {
      int x = q[i].second.first;
      val = left;
      up = pos[x];
      update(1, 0, n - 1);
    }
    if (t == 3) {
      int x = q[i].second.first;
      int y = q[i].second.second;
      Vector lp0 = min(lp[x], lp[y]);
      Vector rp0 = max(rp[x], rp[y]);
      if (dot(lp0, rp0) < 0) {
        printf("NO\n");
        continue;
      }
      int low = 0;
      int high = n - 1;
      int mid;
      int ans;
      while (low <= high) {
        mid = (low + high) / 2;
        if (b[mid] < lp0) {
          low = mid + 1;
        } else {
          ans = mid;
          high = mid - 1;
        }
      }
      val = left;
      up = pos[x];
      update(1, 0, n - 1);
      val = left;
      up = pos[y];
      update(1, 0, n - 1);
      re = left;
      ql = ans;
      qr = n - 1;
      query(1, 0, n - 1);
      if (rp0 < re) {
        printf("YES\n");
      } else {
        printf("NO\n");
      }
      val = rp[x];
      up = pos[x];
      update(1, 0, n - 1);
      val = rp[y];
      up = pos[y];
      update(1, 0, n - 1);
    }
  }
  return 0;
}