#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int MOD = 1000000;
const double INF = 1e9;
struct Point {
  double x, y;
  Point() {}
  Point(double a, double b) : x(a), y(b) {}
  Point operator+(const Point &r) const { return Point(x + r.x, y + r.y); }
  Point operator-(const Point &r) const { return Point(x - r.x, y - r.y); }
  double cross(const Point &r) const { return x * r.y - r.x * y; }
  bool operator<(const Point &r) const { return x == r.x ? y < r.y : x < r.x; }
};
int K[MAXN], A[MAXN], B[MAXN];
long long m, last = 0;
int q, x, y, t, h;
set<Point> myset;
set<Point>::iterator cur, pre;
void Insert(int x, int y) {
  Point p(x, y);
  if (myset.find(p) != myset.end()) return;
  cur = myset.upper_bound(Point(x, INF));
  pre = cur--;
  if (pre->x == INF && x == cur->x && y > cur->y) return;
  if (pre->x != INF) {
    double s = (p - *cur).cross(*pre - *cur);
    if (s <= 0) return;
  }
  if (cur != myset.begin()) {
    for (pre = cur--;; pre = cur--) {
      double s = (p - *cur).cross(*pre - *cur);
      if (s >= 0)
        myset.erase(pre);
      else
        break;
      if (cur == myset.begin()) break;
    }
  }
  myset.insert(p);
}
bool check(double x, double H) {
  cur = myset.upper_bound(Point(x, INF));
  pre = cur--;
  if (pre->x == INF && x > cur->x) return 0;
  double x2 = pre->x, y2 = pre->y, x1 = cur->x, y1 = cur->y;
  double y = (x - x1) * (y2 - y1) / (x2 - x1) + y1;
  return (y <= H);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> q >> m;
  for (int i = 1; i <= q; i++) cin >> K[i] >> A[i] >> B[i];
  myset.insert(Point(0, 0));
  myset.insert(Point(INF, INF));
  for (int i = 1; i <= q; i++) {
    switch (K[i]) {
      case 1:
        cin >> x >> y, x = (A[i] + last) % MOD + 1, y = (B[i] + last) % MOD + 1;
        Insert(x, y);
        break;
      case 2:
        cin >> t >> h, t = (A[i] + last) % MOD + 1, h = (B[i] + last) % MOD + 1;
        bool ret = check((double)(h) / t, (double)(m) / t);
        cout << (ret ? "YES" : "NO") << endl;
        if (ret) last = i;
        break;
    }
  }
  return 0;
}
