#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e6;
struct Point {
  long long x, y, k;
  Point() {}
  Point(long long xx, long long yy) {
    x = xx;
    y = yy;
    k = 1;
  }
  Point(long long xx, long long yy, long long kk) {
    x = xx;
    y = yy;
    k = kk;
  }
  bool operator<(const Point& p) const {
    if (x * p.k == p.x * k) {
      return y * p.k < p.y * k;
    } else {
      return x * p.k < p.x * k;
    }
  }
};
struct Vector {
  long long x, y, k;
  Vector() {}
  Vector(long long xx, long long yy) {
    x = xx;
    y = yy;
    k = 1;
  }
  Vector(long long xx, long long yy, long long kk) {
    x = xx;
    y = yy;
    k = kk;
  }
  Vector(Point p1, Point p2) {
    x = p2.x * p1.k - p1.x * p2.k;
    y = p2.y * p1.k - p1.y * p2.k;
    k = p1.k * p2.k;
  }
};
long long operator%(Vector a, Vector b) { return (a.x * b.y - a.y * b.x); }
int q;
long long m;
set<Point> ch;
set<Point>::iterator get_it_l(set<Point>::iterator it) {
  it--;
  return it;
}
set<Point>::iterator get_it_r(set<Point>::iterator it) {
  it++;
  return it;
}
void add_point(Point p) {
  if (ch.count(p)) {
    return;
  }
  ch.insert(p);
  auto it = ch.lower_bound(p);
  auto it_l = get_it_l(it);
  auto it_r = get_it_r(it);
  if (it_r == ch.end()) {
    if (it_l->x == it->x) {
      ch.erase(it);
      return;
    } else {
      while (true) {
        it = ch.lower_bound(p);
        auto it_l1 = get_it_l(it);
        if (it_l1 == ch.begin()) {
          break;
        }
        auto it_l2 = get_it_l(it_l1);
        if ((Vector(*it_l2, *it_l1) % Vector(*it_l2, *it)) > 0) {
          break;
        } else {
          ch.erase(it_l1);
        }
      }
    }
  } else if ((Vector(*it_l, *it) % Vector(*it_l, *it_r)) > 0) {
    while (true) {
      it = ch.lower_bound(p);
      auto it_l1 = get_it_l(it);
      if (it_l1 == ch.begin()) {
        break;
      }
      auto it_l2 = get_it_l(it_l1);
      if ((Vector(*it_l2, *it_l1) % Vector(*it_l2, *it)) > 0) {
        break;
      } else {
        ch.erase(it_l1);
      }
    }
    while (true) {
      it = ch.lower_bound(p);
      auto it_r1 = get_it_r(it);
      if (it_r1 == ch.end()) {
        break;
      }
      auto it_r2 = get_it_r(it_r1);
      if (it_r2 == ch.end()) {
        if (it_r1->x == it->x) {
          ch.erase(it_r1);
        }
        break;
      }
      if ((Vector(*it, *it_r1) % Vector(*it, *it_r2)) > 0) {
        break;
      } else {
        ch.erase(it_r1);
      }
    }
  } else {
    ch.erase(it);
    return;
  }
}
bool can_kill(long long t, long long x) {
  long long y = m;
  Point mp(x, y, t);
  if (ch.find(mp) != ch.end()) {
    return true;
  }
  ch.insert(mp);
  auto it = ch.lower_bound(mp);
  auto it_l = get_it_l(it);
  auto it_r = get_it_r(it);
  if (it_r == ch.end()) {
    if (it_l->x * it->k == it->x * it_l->k) {
      ch.erase(it);
      return true;
    } else {
      ch.erase(it);
      return false;
    }
  } else if ((Vector(*it_l, *it) % Vector(*it_l, *it_r)) > 0) {
    ch.erase(it);
    return false;
  } else {
    ch.erase(it);
    return true;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> q >> m;
  ch.insert(Point(0, 0));
  long long j = 0;
  for (int i = 0; i < q; ++i) {
    long long k, a, b;
    cin >> k >> a >> b;
    if (k == 1) {
      long long x = (a + j) % MOD + 1;
      long long y = (b + j) % MOD + 1;
      add_point(Point(x, y));
    } else {
      long long t = (a + j) % MOD + 1;
      long long h = (b + j) % MOD + 1;
      bool fl = can_kill(t, h);
      if (fl) {
        j = i + 1;
        cout << "YES\n";
      } else {
        cout << "NO\n";
      }
    }
  }
  cout << endl;
  return 0;
}
