#include <bits/stdc++.h>
struct Point {
  double x, y;
  Point(double X, double Y) : x(X), y(Y) {}
  friend Point operator+(const Point &a, const Point &b) {
    return Point(a.x + b.x, a.y + b.y);
  }
  friend Point operator-(const Point &a, const Point &b) {
    return Point(a.x - b.x, a.y - b.y);
  }
  friend double cross(const Point &a, const Point &b) {
    return a.x * b.y - a.y * b.x;
  }
  friend bool operator<(const Point &a, const Point &b) {
    return a.x == b.x ? a.y < b.y : a.x < b.x;
  }
};
std::set<Point> s;
int q;
double m;
void insert(Point a) {
  auto nxt = s.lower_bound(a), pre = prev(nxt);
  if (nxt != s.end() && cross(*pre - a, *nxt - a) >= 0) {
    return;
  }
  if (nxt != s.end()) {
    while (next(nxt) != s.end() && cross(a - *nxt, *next(nxt) - *nxt) >= 0) {
      ++nxt;
      s.erase(prev(nxt));
    }
  }
  while (pre != s.begin() && cross(*prev(pre) - *pre, a - *pre) >= 0) {
    --pre;
    s.erase(next(pre));
  }
  s.insert(a);
}
bool check(double a, double b) {
  Point tmp(b / a, m / a);
  auto nxt = s.lower_bound(Point(b / a, 0)), pre = prev(nxt);
  return nxt == s.end() ? 0 : cross(*pre - tmp, *nxt - tmp) >= 0;
}
int main() {
  scanf("%d %lf", &q, &m);
  s.insert(Point(0, 0));
  for (int i = 1, op, x, y, lst = 0; i <= q; ++i) {
    scanf("%d %d %d", &op, &x, &y);
    x = (x + lst) % 1000000 + 1;
    y = (y + lst) % 1000000 + 1;
    if (op == 1) {
      insert(Point(x, y));
    } else {
      bool flag = check(x, y);
      if (flag) {
        puts("YES");
        lst = i;
      } else {
        puts("NO");
      }
    }
  }
}
