#include <bits/stdc++.h>
static inline int ri() {
  int a;
  scanf("%d", &a);
  return a;
}
static inline int64_t rs64() {
  int64_t a;
  scanf("%" SCNd64, &a);
  return a;
}
static inline void wi(int a) { printf("%d", a); }
static inline void wu64(uint64_t a) { printf("%" PRIu64, a); }
bool judge(int64_t a, int64_t b, int64_t c, int64_t d) {
  if (a < b) return false;
  if (b > d) return false;
  if (b == d) return ((a % b) <= c);
  if (b <= c) return true;
  if (a == b) return true;
  int64_t first = c - ((b - (a - c - 1) % b - 1));
  if (first < 0) return false;
  int64_t gc;
  {
    int64_t b_ = b;
    int64_t d_ = d;
    while (b_ && d_) {
      if (b_ > d_)
        b_ %= d_;
      else
        d_ %= b_;
    }
    gc = (((b_) > (d_)) ? (b_) : (d_));
  }
  if (b - c - 1 >= gc) return false;
  if (b - c <= 1) return true;
  int64_t bb = (b - 1) % gc;
  int64_t cc = (c + 1) % gc;
  if (bb == cc)
    return !(first % gc == bb);
  else if (bb < cc)
    return !(first % gc >= bb || first % gc <= cc);
  else
    return !(first % gc >= bb && first % gc <= cc);
}
int main() {
  int t = ri();
  int64_t a[t];
  int64_t b[t];
  int64_t c[t];
  int64_t d[t];
  for (register int i = 0; i < t; i++) {
    a[i] = rs64();
    b[i] = rs64();
    c[i] = rs64();
    d[i] = rs64();
  }
  for (register int i = 0; i < t; i++)
    printf("%s\n", judge(a[i], b[i], c[i], d[i]) ? "Yes" : "No");
  return 0;
}
