#include <bits/stdc++.h>
using namespace std;
char B[1 << 26], *S = B;
inline int read() {
  int x, f = 1;
  char c;
  while ((c = *S++) < '0' || c > '9')
    if (c == '-') f = 0;
  for (x = c - '0'; (c = *S++) >= '0' && c <= '9';) x = x * 10 + c - '0';
  return f ? x : -x;
}
struct vec {
  int x, y;
  friend bool operator<(const vec& a, const vec& b) {
    return 1LL * a.x * b.y < 1LL * a.y * b.x;
  }
  friend bool operator==(const vec& a, const vec& b) {
    return 1LL * a.x * b.y == 1LL * a.y * b.x;
  }
};
vec rot(const vec& a) { return (vec){a.y, -a.x}; }
struct work {
  int t, z;
  vec x, y;
} w[500000 + 5], q[500000 + 5];
bool cmp(const work& a, const work& b) {
  return a.x == b.x ? a.t > b.t : a.x < b.x;
}
vec l[500000 + 5], r[500000 + 5], c[500000 + 5];
int cnt, ans[500000 + 5], t[524288 * 2 + 5], qn, sa[500000 + 5], sb[500000 + 5];
void add(int k, int x) {
  for (k += 524288; k; k >>= 1) t[k] += x;
}
int query(int l, int r) {
  int res = 0;
  for (l += 524288 - 1, r += 524288 + 1; l ^ r ^ 1; l >>= 1, r >>= 1) {
    if (~l & 1) res += t[l + 1];
    if (r & 1) res += t[r - 1];
  }
  return res;
}
void solve(int l, int r) {
  int mid = l + r >> 1, i;
  if (l < r) solve(l, mid), solve(mid + 1, r);
  if (sa[mid] == sa[l - 1] || sb[r] == sb[mid]) return;
  for (qn = 0, i = l; i <= mid; ++i)
    if (w[i].t > 0) q[++qn] = w[i];
  for (; i <= r; ++i)
    if (!w[i].t) q[++qn] = w[i];
  sort(q + 1, q + qn + 1, cmp);
  for (i = 1; i <= qn; ++i)
    if (q[i].t)
      add(lower_bound(c + 1, c + cnt + 1, q[i].y) - c, q[i].z);
    else
      ans[q[i].z] += query(lower_bound(c + 1, c + cnt + 1, q[i].y) - c, cnt);
  for (i = 1; i <= qn; ++i)
    if (q[i].t) add(lower_bound(c + 1, c + cnt + 1, q[i].y) - c, -q[i].z);
}
int main() {
  B[fread(B, 1, 1 << 26, stdin)] = 0;
  int R = read(), n = read(), i, t, x, y;
  for (i = 1; i <= n; ++i) {
    t = read();
    x = read();
    sa[i] = sa[i - 1];
    sb[i] = sb[i - 1];
    if (t == 1) {
      l[++cnt] = (vec){x + R, y = read()};
      c[cnt] = r[cnt] = (vec){x - R, y};
      w[i] = (work){1, 1, l[cnt], r[cnt]}, ++sa[i];
    }
    if (t == 2) w[i] = (work){1, -1, l[x], r[x]}, ++sa[i];
    if (t == 3) {
      if (l[y = read()] < l[x]) x ^= y ^= x ^= y;
      if (rot(r[x]) < l[y])
        w[i] = (work){-1, 0, 0, 0}, ans[i] = 3;
      else
        w[i] = (work){0, i, l[y], r[x] < r[y] ? r[x] : r[y]}, ++sb[i];
    }
  }
  sort(c + 1, c + cnt + 1);
  cnt = unique(c + 1, c + cnt + 1) - c - 1;
  solve(1, n);
  for (i = 1; i <= n; ++i)
    if (ans[i]) puts(ans[i] > 2 ? "NO" : "YES");
}
