#include <bits/stdc++.h>
using namespace std;
const int mod = 1e6;
const long double eps = 1e-9;
class point {
 public:
  long long x, y;
  bool operator<(const point& o) const {
    return (x == o.x) ? y < o.y : x < o.x;
  }
};
long long divup(const long long& a, const long long& b) {
  return (a + b - 1) / b;
}
bool under(const point& a, const point& b, const point& x) {
  return (a.x - b.x) * (x.y - b.y) - (x.x - b.x) * (a.y - b.y) > 0;
}
set<point> s;
void insert(const point& x) {
  auto nx = s.lower_bound(x), pv = prev(nx);
  if (nx != s.end() && !under(*pv, *nx, x)) return;
  while (pv != s.begin() && !under(*prev(pv), x, *pv)) s.erase(pv--);
  while (nx != s.end() && next(nx) != s.end() && !under(x, *next(nx), *nx))
    s.erase(nx++);
  s.insert(x);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int Q;
  long double m;
  cin >> Q >> m;
  s.insert({0, 0});
  int last = 0;
  for (int q = 1; q <= Q; q++) {
    int k, a, b;
    cin >> k >> a >> b;
    if (k == 1) {
      int x = (a + last) % mod + 1, y = (b + last) % mod + 1;
      insert({x, y});
    } else {
      long long t = (a + last) % mod + 1, h = (b + last) % mod + 1;
      auto it = s.lower_bound({divup(h, t), -1});
      if (it == s.end())
        cout << "NO\n";
      else {
        point p1 = *prev(it), p2 = *it;
        long double x = (long double)h / (long double)t - (long double)p1.x;
        long double slope =
            (long double)(p2.y - p1.y) / (long double)(p2.x - p1.x);
        long double cost = (long double)p1.y + x * slope;
        bool ans = cost < m / (long double)t + eps;
        if (ans) last = q;
        cout << (ans ? "YES\n" : "NO\n");
      }
    }
  }
  return 0;
}
