#include <bits/stdc++.h>
using namespace std;
struct point {
  long long x, y;
  point(long long _x, long long _y) {
    x = _x;
    y = _y;
  }
  point() {}
};
struct cmp {
  bool operator()(point a, point b) { return (a.x < b.x); }
};
struct vec {
  long long x, y;
  vec(long long _x, long long _y) {
    x = _x;
    y = _y;
  }
  vec() {}
};
set<point, cmp> daftar;
int q, jenis, last = 0;
long long totalmana, a, b;
bool ans;
long double gradien(point p1, point p2) {
  return (long double)(p1.y - p2.y) / (p1.x - p2.x);
}
long double manacost(long double indeks) {
  set<point, cmp>::iterator it1, it2;
  it1 = daftar.lower_bound(point((long long)indeks, 0));
  it2 = daftar.upper_bound(point((long long)indeks, 0));
  if (it1 == it2) it1--;
  if (it2 == daftar.end()) return 1000000000001LL;
  return (long double)it1->y +
         gradien(*it1, *it2) * ((long double)indeks - it1->x);
}
vec toVec(point awal, point akhir) {
  return vec(akhir.x - awal.x, akhir.y - awal.y);
}
long double cross(vec v1, vec v2) {
  return (long double)v1.x * v2.y - (long double)v1.y * v2.x;
}
long double cross(point p1, point p2, point p3) {
  return cross(toVec(p1, p2), toVec(p1, p3));
}
int keatas(int pembilang, int penyebut) {
  int ret = pembilang / penyebut;
  if ((pembilang % penyebut) != 0) ret++;
  return ret;
}
void seimbangkan(point baru) {
  auto it = daftar.find(baru);
  while (prev(it) != daftar.begin()) {
    auto it2 = prev(it);
    auto it3 = prev(it2);
    if (cross(*it3, *it2, *it) > 1e-9) break;
    daftar.erase(it2);
  }
  while (next(it) != daftar.end()) {
    auto it2 = next(it);
    auto it3 = next(it2);
    if (cross(*it, *it2, *it3) > 1e-9) break;
    daftar.erase(it2);
  }
}
int main() {
  daftar.insert(point(0, 0));
  scanf("%d%lld", &q, &totalmana);
  for (int query = 1; query <= q; query++) {
    scanf("%d%lld%lld", &jenis, &a, &b);
    a = (a + last) % 1000000 + 1;
    b = (b + last) % 1000000 + 1;
    if (jenis == 1) {
      if (manacost(a) > (long double)b + 1e-9) {
        daftar.erase(point(a, b));
        daftar.insert(point(a, b));
        seimbangkan(point(a, b));
      }
    } else {
      swap(a, b);
      auto it = daftar.lower_bound(point((a + b - 1) / b, 0));
      ans = false;
      if (it != daftar.end()) {
        auto it2 = prev(it);
        if (cross(point(it2->x * b, it2->y * b), point(a, totalmana),
                  point(it->x * b, it->y * b)) < 1e-9)
          ans = true;
      }
      if (ans)
        printf("YES\n"), last = query;
      else
        printf("NO\n");
    }
  }
}
