#include <bits/stdc++.h>
signed main() {
  long long T, t, A, B, C, D, k, i;
  scanf("%lld", &T);
  for (t = 0; t < T; t++) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    if (A < B || B > D) {
      printf("No\n");
      continue;
    }
    if (C >= B) {
      printf("Yes\n");
      continue;
    }
    long long f = 0;
    for (i = 0; i < C; i++) {
      k = (A - C + B - 1) / B;
      A = A - k * B;
      if (A < 0) {
        printf("No\n");
        f = 1;
        break;
      }
      A += D;
    }
    if (f == 1) {
      continue;
    }
    printf("Yes\n");
  }
  return 0;
}
