#include <bits/stdc++.h>
int main(void) {
  int t, y[301], i;
  long long int a[301], b[301], c[301], d[301];
  long long int A, B, C, D, s;
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    scanf("%lld%lld%lld%lld", &a[i], &b[i], &c[i], &d[i]);
    y[i] = 1;
  }
  for (i = 0; i < t; i++) {
    A = a[i];
    B = b[i];
    C = c[i];
    D = d[i];
    s = A;
    while (s) {
      s = s - B;
      if (s < 0) {
        y[i] = 1;
        break;
      }
      if (s <= C) s = s + D;
      if (s == A) {
        y[i] = 0;
        break;
      }
    }
  }
  for (i = 0; i < t; i++) {
    if (y[i] == 0) printf("Yes\n");
    if (y[i] == 1) printf("No\n");
  }
  return 0;
}
