#include <bits/stdc++.h>
using namespace std;
inline long long gi() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  long long sum = 0;
  while ('0' <= c && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  return sum;
}
const int maxn = 200005, mod = 1e6;
int n, O;
long long m;
struct point {
  long long x, y;
  point(long long _x = 0, long long _y = 0) {
    x = _x;
    y = _y;
  }
};
point operator+(point a, point b) { return point(a.x + b.x, a.y + b.y); }
point operator-(point a, point b) { return point(a.x - b.x, a.y - b.y); }
bool operator<(point a, point b) { return a.x != b.x ? a.x < b.x : a.y < b.y; }
set<point> S;
inline double cross(point a, point b) {
  return 1. * a.x * b.y - 1. * a.y * b.x;
}
bool check(point a, point b, point c) { return cross(b - a, c - a) <= 0; }
void insert(point p) {
  auto it = S.lower_bound(p);
  if (it != S.end() && it->y <= p.y) return;
  if (it != S.end() && check(*prev(it), p, *it)) return;
  it = (S.insert(p)).first;
  while (next(it) != S.end() && next(it)->x == p.x) S.erase(next(it));
  if (next(it) != S.end() && next(next(it)) != S.end())
    while (next(next(it)) != S.end() && check(*it, *next(it), *next(next(it))))
      S.erase(next(it));
  while (prev(it) != S.begin() && check(*prev(prev(it)), *prev(it), *it))
    S.erase(prev(it));
}
bool check(long long x, long long y) {
  auto it = S.lower_bound(point((y + x - 1) / x, 0));
  if (it == S.end()) return 0;
  if (it->y * x <= m) return 1;
  auto pre = prev(it);
  if (check(point(pre->x * x, pre->y * x), point(y, m),
            point(it->x * x, it->y * x)))
    return 1;
  return 0;
}
int main() {
  n = gi();
  m = gi();
  O = 1;
  S.insert(point(0, 0));
  for (int x, a, b, lst = 0, i = 1; i <= n; ++i) {
    x = gi();
    a = gi();
    b = gi();
    if (O) a = (a + lst) % mod + 1, b = (b + lst) % mod + 1;
    if (x == 1)
      insert((point){a, b});
    else if (check(a, b))
      lst = i, puts("YES");
    else
      puts("NO");
  }
  return 0;
}
