#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
struct angle {
  long long y, x;
  bool operator<(const angle& a2) const { return x * a2.y - y * a2.x > 0; }
  bool operator==(const angle& a2) const { return x * a2.y == y * a2.x; }
  bool operator<=(const angle& a2) const { return *this < a2 || *this == a2; }
  bool operator>=(const angle& a2) const { return !(*this < a2); }
  angle operator+(const angle& a2) const {
    return {y * a2.x + a2.y * x, x * a2.x - y * a2.y};
  }
};
struct SegTree {
  int sz;
  angle* tree;
  SegTree(int _sz) {
    sz = 1 << (32 - __builtin_clz(_sz - 1));
    tree = new angle[2 * sz];
    for (int i = 0; i < (2 * sz); i++) tree[i] = angle({0, 1});
  }
  void upd(int idx, angle v) {
    idx += sz;
    tree[idx] = v;
    for (idx /= 2; idx > 0; idx /= 2)
      tree[idx] = max(tree[2 * idx], tree[2 * idx + 1]);
  }
  angle query(int lo, int hi) {
    lo += sz, hi += sz;
    angle res = angle({0, 1});
    while (lo <= hi) {
      if ((lo % 2) == 1) res = max(res, tree[lo++]);
      if ((hi % 2) == 0) res = max(res, tree[hi--]);
      lo /= 2;
      hi /= 2;
    }
    return res;
  }
};
long long r;
angle alpha[500000], beta123[500000];
int n, q, posof[500000];
vector<pair<angle, int>> order;
vector<pair<int, int>> updates;
vector<pair<int, pair<int, int>>> queries;
SegTree st(2);
void toggle(int idx) {
  int pos = posof[idx];
  if (st.query(pos, pos) == angle({0, 1}))
    st.upd(pos, beta123[idx]);
  else
    st.upd(pos, {0, 1});
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> r >> q;
  for (int i = 0; i < (q); i++) {
    int t;
    cin >> t;
    switch (t) {
      case 1:
        long long x, y;
        cin >> x >> y;
        alpha[n] = {y, r - x};
        beta123[n] = {y, x + r};
        updates.push_back(make_pair(i, n++));
        break;
      case 2:
        int idx;
        cin >> idx;
        idx--;
        updates.push_back(make_pair(i, idx));
        break;
      case 3:
        int a, b;
        cin >> a >> b;
        a--, b--;
        queries.push_back(make_pair(i, make_pair(a, b)));
        break;
    }
  }
  for (int i = 0; i < (n); i++) order.push_back(make_pair(alpha[i], i));
  sort((order).begin(), (order).end());
  for (int i = 0; i < (n); i++) posof[order[i].second] = i;
  reverse((updates).begin(), (updates).end());
  reverse((queries).begin(), (queries).end());
  st = SegTree(n);
  while (!updates.empty() || !queries.empty()) {
    if (queries.empty() ||
        (!updates.empty() && updates.back().first < queries.back().first)) {
      int idx = updates.back().second;
      updates.pop_back();
      toggle(idx);
    } else {
      int a = queries.back().second.first;
      int b = queries.back().second.second;
      queries.pop_back();
      angle _alpha = min(alpha[a], alpha[b]);
      angle _beta123 = min(beta123[a], beta123[b]);
      if (_alpha + _beta123 < angle({1, 0})) {
        cout << "NO\n";
      } else {
        toggle(a);
        toggle(b);
        int lo =
            lower_bound((order).begin(), (order).end(), make_pair(_alpha, 0)) -
            order.begin();
        assert(lo == 0 || order[lo - 1].first < _alpha);
        if (st.query(lo, n - 1) >= _beta123)
          cout << "NO\n";
        else
          cout << "YES\n";
        toggle(a);
        toggle(b);
      }
    }
  }
}
