#include <bits/stdc++.h>
using namespace std;
int lasans;
long long m;
int n;
set<pair<double, double> > s;
pair<double, double> decc(pair<double, double> x, pair<double, double> y) {
  return make_pair(x.first - y.first, x.second - y.second);
}
double mult(pair<double, double> x, pair<double, double> y) {
  return x.first * y.second - x.second * y.first;
}
bool up(pair<double, double> p1, pair<double, double> p2,
        pair<double, double> p3) {
  pair<double, double> tmp1 = decc(p2, p1);
  pair<double, double> tmp2 = decc(p3, p1);
  if (mult(tmp1, tmp2) <= 1e-6)
    return 1;
  else
    return 0;
}
int main() {
  s.insert(make_pair(0, 0));
  scanf("%d%I64d", &n, &m);
  int wz = 0;
  while (n--) {
    wz++;
    int Type, x, y;
    scanf("%d%d%d", &Type, &x, &y);
    x = (x + lasans) % 1000000 + 1;
    y = (y + lasans) % 1000000 + 1;
    if (Type == 1) {
      set<pair<double, double> >::iterator now = s.lower_bound(make_pair(x, 0));
      if (now != s.end() && (*now).second <= y) continue;
      set<pair<double, double> >::iterator last = now, next, laslas;
      last--;
      if (now != s.end() && up(*last, make_pair(x, y), *now)) continue;
      now = s.insert(make_pair(x, y)).first;
      last = now;
      last--;
      laslas = last;
      laslas--;
      next = now;
      next++;
      while (next != s.end() && (*next).first == x) {
        set<pair<double, double> >::iterator nextnext = next;
        nextnext++;
        s.erase(next);
        next = nextnext;
      }
      while (last != s.begin() && up((*laslas), (*last), *now)) {
        set<pair<double, double> >::iterator tmp = laslas;
        tmp--;
        s.erase(last);
        last = laslas;
        laslas = tmp;
      }
    } else {
      bool ok = 0;
      set<pair<double, double> >::iterator tmp =
          s.lower_bound(make_pair(1.0 * y / x, 0));
      if (tmp != s.end()) {
        if ((*tmp).second * x <= m) {
          ok = 1;
        } else {
          set<pair<double, double> >::iterator las = tmp;
          las--;
          if (up((*las), make_pair(1.0 * y / x, 1.0 * m / x), (*tmp))) ok = 1;
        }
      }
      if (ok) {
        puts("YES");
        lasans = wz;
      } else
        puts("NO");
    }
  }
  return 0;
}
