#include <bits/stdc++.h>
using namespace std;
int qq;
long long m;
int k;
long long a, b;
typedef struct DATtype {
  long long a, b;
} DAT;
void DAT_insert(vector<DAT>& x, const DAT& y) {
  int ata = 0, atb = x.size();
  while (atb - ata > 1) {
    int mid = (ata + atb) / 2;
    if (x[mid].a > y.a)
      atb = mid;
    else if (x[mid].a == y.a)
      ata = mid, atb = mid + 1;
    else
      ata = mid;
  }
  if (ata < x.size() && x[ata].a == y.a) {
    if (x[ata].b > y.b) x[ata] = y;
  } else {
    if (x.size() == 0)
      x.insert(x.begin() + ata, y);
    else {
      if (x[ata].a < y.a)
        x.insert(x.begin() + ata + 1, y);
      else
        x.insert(x.begin() + ata, y);
    }
    long long ky = 0, kx = 1, ly, lx;
    for (int i = 0; i < x.size() - 1; i++) {
      ly = x[i + 1].b - x[i].b;
      lx = x[i + 1].a - x[i].a;
      if (ly < 0 || ly * kx <= ky * lx) {
        x.erase(x.begin() + i);
        if (i == 0)
          ky = 0, kx = 1;
        else {
          ky = x[i].b - x[i - 1].b;
          kx = x[i].a - x[i - 1].a;
        }
        i--;
      }
    }
  }
}
bool DAT_verify(const vector<DAT>& x, long long a, long long b) {
  int ata = 0, atb = x.size();
  while (atb - ata > 1) {
    int mid = (ata + atb) / 2;
    if (x[mid].a * a > b)
      atb = mid;
    else if (x[mid].a * a == b)
      ata = mid, atb = mid + 1;
    else
      ata = mid;
  }
  for (int i = ata; i < x.size(); i++) {
    if (x[i].a * a >= b) {
      if (x[i].b * b <= m * x[i].a) return true;
    } else if (i != x.size() - 1) {
      if ((b - x[i].a * a) * (x[i + 1].b - x[i].b) +
              x[i].b * a * (x[i + 1].a - x[i].a) <=
          m * (x[i + 1].a - x[i].a))
        return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> qq >> m;
  int j = 0;
  bool unrivalled = false;
  vector<DAT> old;
  for (int i = 0; i < qq; i++) {
    cin >> k >> a >> b;
    a = (a + j) % 1000000 + 1;
    b = (b + j) % 1000000 + 1;
    if (k == 1) {
      if (a == 0)
        continue;
      else if (b == 0)
        unrivalled = true;
      else {
        DAT k = {.a = a, .b = b};
        DAT_insert(old, k);
      }
    } else {
      if (unrivalled) {
        cout << "YES" << endl;
        j = i + 1;
      } else if (a == 0) {
        cout << "NO" << endl;
      } else if (b == 0) {
        cout << "YES" << endl;
        j = i + 1;
      } else {
        if (DAT_verify(old, a, b)) {
          cout << "YES" << endl;
          j = i + 1;
        } else
          cout << "NO" << endl;
      }
    }
  }
  return 0;
}
