#include <bits/stdc++.h>
using namespace std;
const int mod = 1e6;
const long double EPS = 1e-9;
inline long long read() {
  long long sum = 0, t = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') t = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = sum * 10 + ch - '0';
    ch = getchar();
  }
  return sum * t;
}
int q, las;
long long m;
struct Point {
  long double x, y;
  Point() {}
  Point(long double _, long double __) : x(_), y(__) {}
  Point operator+(const Point &a) const { return Point(x + a.x, y + a.y); }
  Point operator-(const Point &a) const { return Point(x - a.x, y - a.y); }
  Point operator*(const long double &k) const { return Point(x * k, y * k); }
  long double operator*(const Point &a) const { return x * a.y - y * a.x; }
  long double operator&(const Point &a) const { return x * a.x + y * a.y; }
  bool operator<(const Point &a) const { return x == a.x ? y < a.y : x < a.x; }
};
set<Point> S;
void insert(Point u) {
  set<Point>::iterator it1 = S.lower_bound(u), it2 = it1;
  if (it1 != S.end()) {
    it2--;
    if ((*it1 - *it2) * (u - *it2) >= -EPS) return;
  }
  while (it1 != S.end()) {
    it2 = it1;
    it2--;
    if (it2 == S.end() || (*it1 - u) * (*it2 - u) > EPS) break;
    S.erase(it1);
    it1 = S.lower_bound(u);
  }
  it1 = S.lower_bound(u);
  it1--;
  while (it1 != S.begin()) {
    it2 = it1;
    it2--;
    if ((*it2 - u) * (*it1 - u) > EPS) break;
    S.erase(it1);
    it1 = S.lower_bound(u);
    it1--;
  }
  S.insert(u);
}
bool check(int t, int h) {
  set<Point>::iterator it = S.lower_bound(Point(1.0 * h / t, 0)), it2;
  if (it == S.end()) return false;
  it2 = it;
  it2--;
  Point v = *it - *it2;
  v = v * ((1.0 * h / t - it2->x) / (it->x - it2->x)) + *it2;
  return 1.0 * m / t - v.y >= -EPS;
}
int main() {
  S.insert(Point(0, 0));
  q = read(), m = read();
  for (int i = 1; i <= q; i++) {
    int op = read(), x = (read() + las) % mod + 1, y = (read() + las) % mod + 1;
    if (i == 14) {
      i++;
      i--;
    }
    if (op == 1)
      insert(Point(x, y));
    else {
      bool flag = check(x, y);
      if (flag) las = i;
      puts(flag ? "YES" : "NO");
    }
  }
}
