#include <bits/stdc++.h>
using namespace std;
int q;
int k, a, b;
int lastJ = 0;
long long m;
set<pair<int, int>> s;
bool good(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  long long x1 = b.first - a.first, y1 = b.second - a.second;
  long long x2 = c.first - b.first, y2 = c.second - b.second;
  y1 *= x2;
  y2 *= x1;
  return y2 > y1;
}
int main() {
  s.insert({0, 0});
  cin >> q >> m;
  for (int i = 0; i < q; ++i) {
    cin >> k >> a >> b;
    a = (a + lastJ) % 1000000 + 1, b = (b + lastJ) % 1000000 + 1;
    if (k == 1) {
      auto prev = --s.lower_bound({a, b});
      if (prev->first == a) continue;
      auto next = prev;
      next++;
      if (next != s.end() && next->first == a) {
        s.erase(next);
        next = prev;
        next++;
      }
      if (next != s.end() && !good(*prev, {a, b}, *next)) continue;
      s.insert({a, b});
      auto it = s.find({a, b});
      auto third = next;
      third++;
      while (next != s.end() && third != s.end() && !good(*it, *next, *third)) {
        s.erase(next);
        next = third;
        third++;
      }
      third = prev;
      third--;
      while (prev != s.begin() && third != s.end() &&
             !good(*third, *prev, *it)) {
        s.erase(prev);
        prev = third;
        third--;
      }
    } else {
      long double f = (long double)b / (long double)a;
      auto it = s.lower_bound({(int)ceil(f), -1});
      if (it != s.end()) {
        long double x2 = it->first, y2 = it->second;
        it--;
        long double x1 = it->first, y1 = it->second;
        long double z = y1 + (y2 - y1) * ((f - x1) / (x2 - x1));
        if (z * a > m) it = s.end();
      }
      if (it == s.end())
        cout << "NO\n";
      else {
        cout << "YES\n";
        lastJ = i + 1;
      }
    }
  }
}
