#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline T1 min(T1 a, T2 b) {
  return a < b ? a : b;
}
template <typename T1, typename T2>
inline T1 max(T1 a, T2 b) {
  return b < a ? a : b;
}
namespace ae86 {
const int bufl = 1 << 15;
char buf[bufl], *s = buf, *t = buf;
inline int fetch() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, bufl, stdin);
    if (s == t) return EOF;
  }
  return *s++;
}
inline long long ty() {
  long long a = 0;
  int b = 1, c = fetch();
  while (!isdigit(c)) b ^= c == '-', c = fetch();
  while (isdigit(c)) a = a * 10 + c - 48, c = fetch();
  return b ? a : -a;
}
}  // namespace ae86
using ae86::ty;
struct pdd {
  long long x, y;
  pdd(long long _x = 0, long long _y = 0) { x = _x, y = _y; }
  inline friend pdd operator+(pdd a, pdd b) {
    return pdd(a.x + b.x, a.y + b.y);
  }
  inline friend pdd operator-(pdd a, pdd b) {
    return pdd(a.x - b.x, a.y - b.y);
  }
  inline friend int operator<(pdd a, pdd b) {
    if (a.x == b.x) return a.y < b.y;
    return a.x < b.x;
  }
};
inline long double cox(pdd a, pdd b) {
  return (long double)(a.x) * (long double)(b.y) -
         (long double)(a.y) * (long double)(b.x);
}
inline int isonleft(pdd a, pdd b, pdd c) { return cox(b - a, c - a) <= 0; }
set<pdd> t;
inline void pushin(long long x, long long y) {
  auto it = t.lower_bound(pdd(x, y));
  if (it != t.end() && it->y <= y) return;
  auto las = prev(it);
  if (it != t.end() && isonleft(*las, pdd(x, y), *it)) return;
  it = (t.emplace(x, y)).first;
  while (next(it) != t.end() && next(it)->x == x) t.erase(next(it));
  while (prev(it) != t.begin() && isonleft(*prev(prev(it)), *prev(it), *it))
    t.erase(prev(it));
}
long long mp;
inline int able(long long lim, long long hit) {
  auto it = t.lower_bound(pdd((hit + lim - 1) / lim, 0));
  if (it == t.end()) return 0;
  if (it->y * lim <= mp) return 1;
  auto las = prev(it);
  if (isonleft(pdd(las->x * lim, las->y * lim), pdd(hit, mp),
               pdd(it->x * lim, it->y * lim)))
    return 1;
  return 0;
}
int qn;
int main() {
  qn = ty(), mp = ty();
  int isonline = 1;
  t.emplace(0, 0);
  int lasans = 0;
  for (int qq = 1; qq <= qn; qq++) {
    int op = ty(), x = ty(), y = ty();
    if (isonline)
      x = (x + lasans) % 1000000 + 1, y = (y + lasans) % 1000000 + 1;
    if (op == 1)
      pushin(x, y);
    else
      able(x, y) ? (puts("YES"), lasans = qq) : puts("NO");
  }
  return 0;
}
