#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
void ckmin(T &a, U b) {
  if (a > b) a = b;
}
template <class T, class U>
void ckmax(T &a, U b) {
  if (a < b) a = b;
}
const long double EPS = 1e-12;
const long long LLINF = 2696969696969696969ll;
int Q;
long long M;
int lst;
set<pair<long long, long long> > s;
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  return (a.second * b.first <= b.second * a.first);
}
void ins(pair<long long, long long> p) {
  auto it = s.upper_bound(p);
  if (it != s.end() && cmp(*it, p)) {
    return;
  }
  while (prev(it) != s.begin() && cmp(p, *prev(it))) {
    it = s.erase(prev(it));
  }
  s.insert(p);
  return;
}
long double eval(pair<long long, long long> a, pair<long long, long long> b,
                 long double x) {
  return (long double)(x * (b.second - a.second) +
                       (a.second * b.first - a.first * b.second)) /
         (b.first - a.first);
}
bool check(pair<long double, long double> p) {
  if (p.first > s.rbegin()->first + EPS) {
    return false;
  }
  auto it = s.lower_bound({(long long)ceil(p.first - EPS), -LLINF});
  long double y = eval(*prev(it), *it, p.first);
  return (y < p.second + EPS);
}
int32_t main() {
  cout << fixed << setprecision(12);
  cerr << fixed << setprecision(4);
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> Q >> M;
  s.insert({0, 0});
  for (auto i = (1); i < (Q + 1); i++) {
    int qid;
    long long a, b;
    cin >> qid >> a >> b;
    a = (a + lst) % 1000000 + 1;
    b = (b + lst) % 1000000 + 1;
    if (qid == 1) {
      ins({a, b});
    }
    if (qid == 2) {
      bool res = check({(long double)b / a, (long double)M / a});
      if (res) {
        cout << "YES\n";
        lst = i;
      } else {
        cout << "NO\n";
      }
    }
  }
  return 0;
}
