#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
struct point {
  double x, y;
  point(double X = 0, double Y = 0) { x = X, y = Y; }
  point operator-(const point& b) const { return point(x - b.x, y - b.y); }
  double operator*(const point& b) const { return x * b.y - y * b.x; }
  bool operator<(const point& b) const { return x == b.x ? y < b.y : x < b.x; }
};
int q, pre;
long long m;
set<point> s;
inline void ins(double x, double y) {
  point p = point(x, y);
  if (s.count(p)) return;
  auto it = s.lower_bound(point(x, 0)), pre = prev(it);
  if (it != s.end() && (p - *pre) * (*it - p) <= 0) return;
  it = s.insert(p).first;
  --it;
  if (it == s.begin()) return;
  pre = prev(it);
  while (it != s.begin() && (*it - *pre) * (p - *pre) <= 0) {
    s.erase(it);
    it = pre;
    pre = prev(it);
  }
}
inline bool query(double x, double y) {
  point p = point(x, y);
  auto it = s.lower_bound(point(x, 0));
  if (it == s.end()) return 0;
  auto pre = prev(it);
  if ((*it - *pre) * (p - *pre) > -eps) return 1;
  return 0;
}
int main() {
  scanf("%d%lld", &q, &m);
  s.insert(point(0, 0));
  int op, a, b;
  for (int i = 1; i <= q; i++) {
    assert(s.size() <= 2000);
    scanf("%d%d%d", &op, &a, &b);
    a = (a + pre) % 1000000 + 1, b = (b + pre) % 1000000 + 1;
    if (op == 1)
      ins(a, b);
    else {
      if (query(1.0 * b / a, 1.0 * m / a))
        puts("YES"), pre = i;
      else
        puts("NO");
    }
  }
  return 0;
}
