#include <bits/stdc++.h>
long long int gcd(long long int a, long long int b) {
  long long int r = a % b;
  while (r > 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int cond(long long int a, long long int b, long long int c, long long int d) {
  if (a < b) return 0;
  if (d < b) return 0;
  if (c >= b) return 1;
  if (d % b == 0) {
    a = a - (a - c + b - 1) / b * b;
    return a >= 0;
  }
  int iter = 1000000;
  while (iter--) {
    a -= (a - c + b - 1) / b * b;
    if (a < 0) return 0;
    a += d;
  }
  return 1;
}
void run(void) {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long int a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    printf("%s\n", cond(a, b, c, d) ? "Yes" : "No");
  }
}
int main(void) {
  run();
  return 0;
}
