#include <bits/stdc++.h>
using namespace std;
multiset<pair<long double, long double> > S;
int dcmp(long double a) {
  if (fabs(a) <= 1e-11) return 0;
  return a < 0 ? -1 : 1;
}
pair<long double, long double> operator-(pair<long double, long double> x,
                                         pair<long double, long double> y) {
  return pair<long double, long double>(x.first - y.first, x.second - y.second);
}
long double cha(pair<long double, long double> x,
                pair<long double, long double> y) {
  return x.first * y.second - y.first * x.second;
}
bool OK(pair<long double, long double> a, pair<long double, long double> b,
        pair<long double, long double> c) {
  return dcmp(cha(b - a, c - a)) <= 0;
}
void insert(pair<long double, long double> x) {
  multiset<pair<long double, long double> >::iterator it, Ppre, pre, nxt;
  it = S.lower_bound(pair<long double, long double>(x.first, 0));
  if (it != S.end() && (*it).second <= x.second) return;
  pre = it;
  pre--;
  if (it != S.end() && OK(*pre, x, *it)) return;
  nxt = pre = it = S.insert(x);
  Ppre = --pre;
  Ppre--;
  nxt++;
  for (; nxt != S.end() && (*nxt).first == x.first;) S.erase(nxt++);
  for (; pre != S.begin() && OK(*Ppre, *pre, x);) S.erase(pre--), Ppre--;
}
int main() {
  int Q, last = 0;
  long long m;
  scanf("%d%lld", &Q, &m);
  S.insert(pair<long double, long double>(0, 0));
  for (int i = 1; i <= Q; i++) {
    int fl, a, b;
    scanf("%d%d%d", &fl, &a, &b);
    a = (a + last) % 1000000 + 1;
    b = (b + last) % 1000000 + 1;
    if (fl == 1) {
      insert(pair<long double, long double>(a, b));
      continue;
    }
    long double x = 1.0 * b / a;
    multiset<pair<long double, long double> >::iterator it, pre, nxt;
    it = S.lower_bound(pair<long double, long double>(x, 0));
    if (it == S.end()) {
      puts("NO");
      continue;
    }
    if (it->second * a <= m) {
      puts("YES");
      last = i;
      continue;
    }
    pre = it;
    pre--;
    nxt = it;
    if (OK(pair<long double, long double>(pre->first * a, pre->second * a),
           pair<long double, long double>(b, m),
           pair<long double, long double>(it->first * a, it->second * a))) {
      puts("YES");
      last = i;
    } else
      puts("NO");
  }
}
