#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXQ = 100000;
typedef struct F {
  long long num, den;
  F(long long num, long long den) : num(num), den(den) {}
} F;
bool operator<(const F &a, const F &b) { return a.num * b.den < b.num * a.den; }
int nq;
long long havemana;
bool ans[MAXQ];
int nans;
set<pair<int, int> > xmp;
set<F> fmp;
void remspell(set<pair<int, int> >::iterator it) {
  fmp.erase(F(it->second, it->first));
  xmp.erase(it);
}
void addspell(int x, int y) {
  xmp.insert(make_pair(x, y));
  fmp.insert(F(y, x));
}
bool below(pair<int, int> b, pair<int, int> a, pair<int, int> c) {
  int bx = b.first, by = b.second, ax = a.first, ay = a.second, cx = c.first,
      cy = c.second;
  return (long long)(by - ay) * (cx - ax) < (long long)(cy - ay) * (bx - ax);
}
void learn(int x, int y) {
  set<pair<int, int> >::iterator nxt = xmp.lower_bound(make_pair(x, -1));
  if (nxt != xmp.end() && nxt->first == x) {
    if (nxt->second <= y) return;
    remspell(nxt++);
  } else if (nxt != xmp.begin() && nxt != xmp.end()) {
    set<pair<int, int> >::iterator prv = nxt;
    --prv;
    if (!below(make_pair(x, y), *prv, *nxt)) return;
  } else if (nxt == xmp.begin() && nxt != xmp.end()) {
    if (!below(make_pair(x, y), make_pair(0, 0), *nxt)) return;
  }
  while (nxt != xmp.begin()) {
    set<pair<int, int> >::iterator prv = nxt;
    --prv;
    if (prv == xmp.begin()) {
      if (below(*prv, make_pair(0, 0), make_pair(x, y))) break;
    } else {
      set<pair<int, int> >::iterator pprv = prv;
      --pprv;
      if (below(*prv, *pprv, make_pair(x, y))) break;
    }
    remspell(prv);
  }
  while (nxt != xmp.end()) {
    set<pair<int, int> >::iterator nnxt = nxt;
    ++nnxt;
    if (nnxt == xmp.end()) break;
    if (below(*nxt, make_pair(x, y), *nnxt)) break;
    remspell(nxt++);
  }
  addspell(x, y);
}
bool battle(int t, int h) {
  set<F>::iterator nxt = fmp.lower_bound(F(havemana, h));
  if (nxt == fmp.begin()) {
    int x = nxt->den, y = nxt->num;
    return (long long)t * x >= h && havemana * x >= (long long)h * y;
  } else {
    set<F>::iterator prv = nxt;
    --prv;
    if (nxt == fmp.end()) {
      int x = prv->den, y = prv->num;
      return (long long)t * x >= h && havemana * x >= (long long)h * y;
    } else {
      int x1 = prv->den, y1 = prv->num;
      int x2 = nxt->den, y2 = nxt->num;
      return ((long long)t * y2 - havemana) * (x2 - x1) <=
             ((long long)t * x2 - h) * (y2 - y1);
    }
  }
}
void run() {
  scanf("%d%lld", &nq, &havemana);
  int off = 0;
  nans = 0;
  for (int qi = (0); qi < (nq); ++qi) {
    int qtype;
    scanf("%d", &qtype);
    if (qtype == 1) {
      int x, y;
      scanf("%d%d", &x, &y);
      x = (x + off) % 1000000 + 1, y = (y + off) % 1000000 + 1;
      learn(x, y);
    }
    if (qtype == 2) {
      int t, h;
      scanf("%d%d", &t, &h);
      t = (t + off) % 1000000 + 1, h = (h + off) % 1000000 + 1;
      bool res = battle(t, h);
      ans[nans++] = res;
      if (res) off = qi + 1;
    }
  }
  for (int i = (0); i < (nans); ++i) printf("%s\n", ans[i] ? "YES" : "NO");
}
void test(int t, int h) {
  for (int dt = (-1); dt <= (+1); ++dt)
    for (int dh = (-1); dh <= (+1); ++dh) {
      int tt = t + dt, hh = h + dh;
      if (tt >= 1 && hh >= 1)
        printf("(%d,%d)=%s\n", tt, hh, battle(tt, hh) ? "YES" : "NO");
    }
  puts("");
}
void test() {
  learn(1, 10);
  learn(2, 25);
  learn(3, 40);
  learn(4, 60);
  havemana = 600;
  test(61, 75);
  havemana = 600;
  test(60, 60);
  havemana = 600;
  test(42, 54);
  havemana = 600;
  test(24, 48);
  havemana = 600;
  test(18, 46);
  havemana = 600;
  test(15, 45);
  havemana = 600;
  test(14, 44);
  havemana = 600;
  test(10, 40);
  havemana = 600;
  test(9, 30);
}
int main() {
  run();
  return 0;
}
