#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
int IT_MAX = 1 << 19;
const long long MOD = 998244353;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
pair<int, int> operator-(const pair<int, int> &l, const pair<int, int> &r) {
  return pair<int, int>(l.first - r.first, l.second - r.second);
}
long long operator/(const pair<int, int> &l, const pair<int, int> &r) {
  return (long long)l.first * r.second - (long long)l.second * r.first;
}
long long operator*(const pair<int, int> &l, const pair<int, int> &r) {
  return (long long)l.first * r.first + (long long)l.second * r.second;
}
const int MX = 1 << 19;
int ord[MX][3], sz = 0;
pair<int, int> D[MX];
auto cw = [](pair<int, int> l, pair<int, int> r) { return l / r < 0; };
struct Tree {
  int t[MX * 2];
  int read(int s, int e) {
    s += MX, e += MX;
    int r = 0;
    while (s <= e) {
      if (s & 1) r = max(r, t[s++]);
      if (~e & 1) r = max(r, t[e--]);
      s /= 2, e /= 2;
    }
    return r;
  }
  void update(int x, int v) {
    x += MX;
    t[x] = v;
    while (x > 1) {
      x /= 2;
      t[x] = max(t[x * 2], t[x * 2 + 1]);
    }
  }
} tree;
set<int> P[MX];
void add_point(int a, int b) {
  P[a].insert(b);
  tree.update(a, *P[a].rbegin());
}
void erase_point(int a, int b) {
  P[a].erase(b);
  tree.update(a, P[a].empty() ? 0 : *P[a].rbegin());
}
bool solve(int a, int b) {
  if (tree.read(0, a) >= b) return true;
  return false;
}
int main() {
  int N, R;
  vector<pair<int, int> > X, Y;
  scanf("%d%d", &R, &N);
  pair<int, int> A = pair<int, int>(-R, 0), B = pair<int, int>(R, 0);
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < 2; j++) scanf("%d", ord[i] + j);
    if (ord[i][0] != 2) scanf("%d", ord[i] + 2);
    if (ord[i][0] == 1) {
      D[++sz] = pair<int, int>(ord[i][1], ord[i][2]);
      X.push_back(D[sz] - A);
      Y.push_back(D[sz] - B);
    }
  }
  sort(X.begin(), X.end(), cw);
  sort(Y.begin(), Y.end(), cw);
  auto V = [](vector<pair<int, int> > &X, pair<int, int> x) {
    return lower_bound(X.begin(), X.end(), x, cw) - X.begin() + 1;
  };
  for (int i = 1; i <= N; i++) {
    int o = ord[i][0], x = ord[i][1], y = ord[i][2];
    if (o == 1) {
      int a = V(X, pair<int, int>(x, y) - A),
          b = V(Y, pair<int, int>(x, y) - B);
      add_point(a, b);
    } else if (o == 2) {
      int a = V(X, D[x] - A), b = V(Y, D[x] - B);
      erase_point(a, b);
    } else {
      int a = V(X, D[x] - A), b = V(Y, D[x] - B);
      int p = V(X, D[y] - A), q = V(Y, D[y] - B);
      int u = max(a, p), v = min(b, q);
      erase_point(a, b);
      erase_point(p, q);
      if (X[u - 1] * Y[v - 1] >= 0 && !solve(u, v))
        printf("YES\n");
      else
        printf("NO\n");
      add_point(a, b);
      add_point(p, q);
    }
  }
  return 0;
}
