#include <bits/stdc++.h>
using namespace std;
const long long buben = 1e6;
const double eps = 1e-9;
bool lt(double a, double b) { return b - a > eps; }
bool gt(double a, double b) { return a - b > eps; }
bool eq(double a, double b) { return abs(a - b) <= eps; }
bool leq(double a, double b) { return lt(a, b) || eq(a, b); }
bool geq(double a, double b) { return gt(a, b) || eq(a, b); }
struct pt {
  double x, y;
  pt() {}
  pt(double x, double y) : x(x), y(y) {}
  pt operator-(const pt& other) const { return {x - other.x, y - other.y}; }
  bool operator<(const pt& other) const {
    if (x != other.x) {
      return x < other.x;
    }
    return y < other.y;
  }
  bool operator==(const pt& other) const {
    return x == other.x && y == other.y;
  }
};
double cross(const pt& p, const pt& q) { return p.x * q.y - p.y * q.x; }
set<pt> lower;
bool above(const pt& p) {
  if (lower.empty()) {
    return false;
  }
  if ((int)(lower).size() == 1) {
    pt q = *lower.begin();
    return eq(p.x, q.x) && leq(q.y, p.y);
  }
  pt f = *(--lower.end());
  if (gt(p.x, f.x) || (eq(p.x, f.x) && lt(p.y, f.y))) {
    return false;
  }
  if (eq(p.x, f.x)) {
    return true;
  }
  f = *lower.begin();
  if (lt(p.x, f.x) || (eq(p.x, f.x) && lt(p.y, f.y))) {
    return false;
  }
  if (eq(p.x, f.x)) {
    return true;
  }
  set<pt>::iterator it = lower.lower_bound(p);
  set<pt>::iterator pr = it;
  --pr;
  return geq(cross(*it - *pr, p - *pr), 0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  long long m;
  cin >> m;
  int j = 0;
  lower.insert({0, 0});
  for (int step = 1; step <= q; ++step) {
    int type;
    cin >> type;
    if (type == 1) {
      long long x, y;
      cin >> x >> y;
      x = (x + j) % buben + 1;
      y = (y + j) % buben + 1;
      pt p = {double(x), double(y)};
      if (lower.empty()) {
        lower.insert(p);
      } else if (!above(p)) {
        pt f = *(--lower.end());
        if ((p.x == f.x && p.y < f.y) || p.x > f.x) {
          while ((int)(lower).size() >= 2 &&
                 cross(*(--lower.end()) - *(--(--lower.end())),
                       p - *(--lower.end())) <= 0) {
            lower.erase(--lower.end());
          }
          if ((int)(lower).size() == 1 && p.x == lower.begin()->x &&
              p.y <= lower.begin()->y) {
            lower.clear();
          }
          lower.insert(p);
        } else if (p.x < f.x) {
          f = *lower.begin();
          if ((p.x == f.x && p.y < f.y) || p.x < f.x) {
            while ((int)(lower).size() >= 2 &&
                   cross(*lower.begin() - p,
                         *(++lower.begin()) - *(lower.begin())) <= 0) {
              lower.erase(lower.begin());
            }
            if ((int)(lower).size() == 1 && p.x == lower.begin()->x &&
                p.y <= lower.begin()->y) {
              lower.clear();
            }
            lower.insert(p);
          } else if (p.x > f.x) {
            set<pt>::iterator it = lower.lower_bound(p);
            set<pt>::iterator pr = it;
            --pr;
            while (it != --lower.end()) {
              set<pt>::iterator nx = it;
              ++nx;
              if (cross(*it - p, *nx - *it) <= 0) {
                lower.erase(it);
                it = nx;
              } else {
                break;
              }
            }
            while (pr != lower.begin()) {
              set<pt>::iterator nx = pr;
              --nx;
              if (cross(*pr - *nx, p - *pr) <= 0) {
                lower.erase(pr);
                pr = nx;
              } else {
                break;
              }
            }
            lower.insert(p);
          }
        }
      }
    } else {
      long long t, h;
      cin >> t >> h;
      t = (t + j) % buben + 1;
      h = (h + j) % buben + 1;
      pt highest = {double(h) / double(t), double(m) / double(t)};
      if (above(highest)) {
        cout << "YES\n";
        j = step;
      } else {
        cout << "NO\n";
      }
    }
  }
}
