#include <bits/stdc++.h>
using namespace std;
long long read() {
  char c = getchar();
  long long x = 1, s = 0;
  while (c < '0' || c > '9') {
    if (c == '-') x = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    s = s * 10 + c - '0';
    c = getchar();
  }
  return s * x;
}
struct TB {
  long long x, y;
  friend bool operator<(TB u, TB v) {
    if (u.x != v.x)
      return u.x < v.x;
    else
      return u.y < v.y;
  }
  friend long long operator*(TB u, TB v) { return u.x * v.y - u.y * v.x; }
  friend TB operator-(TB u, TB v) { return (TB){u.x - v.x, u.y - v.y}; }
};
set<TB> s;
long long n, m, op, x, y, las;
void insert(long long x, long long y) {
  TB u = {x, y};
  auto it = s.lower_bound(u);
  auto iv = prev(it);
  if (it != s.begin() && (*iv - u) * (*it - u) >= 0) return;
  while (it != s.end() && next(it) != s.end() &&
         (u - *it) * (*next(it) - *it) >= 0) {
    ++it;
    s.erase(prev(it));
  }
  while (iv != s.begin() and (u - *prev(iv)) * (*iv - *prev(iv)) >= 0) {
    --iv;
    s.erase(next(iv));
  }
  s.insert(u);
}
long long query(long long x, long long y) {
  TB u = {(long long)(ceil(1.0 * y / x)), 0ll};
  auto it = s.lower_bound(u);
  if (it == s.begin()) return 0;
  auto iv = prev(it);
  if (it == s.end()) return 0;
  long long at = u.x;
  if ((y - x * iv->x) * (it->y - iv->y) + (iv->y * (it->x - iv->x)) * x <=
      m * (it->x - iv->x))
    return 1;
  else
    return 0;
}
signed main() {
  s.insert((TB){0, 0});
  n = read();
  m = read();
  for (long long i = 1; i <= n; i++) {
    op = read();
    x = (read() + las) % 1000000 + 1;
    y = (read() + las) % 1000000 + 1;
    if (op == 1) {
      insert(x, y);
    } else {
      if (query(x, y)) {
        las = i;
        puts("YES");
      } else
        puts("NO");
    }
  }
  return 0;
}
