#include <bits/stdc++.h>
long long a, b, c, d;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b || d < b) {
      printf("No\n");
      continue;
    }
    bool f = true;
    for (int i = 0; i < 3e4 && f; i++) {
      if (a < b) {
        f = 0;
        break;
      }
      if (a <= c) {
        a -= b;
        a += d;
      } else {
        long long t = (a - c + b - 1) / b;
        a -= t * b;
        if (a < 0) a += b;
        if (a <= c) a += d;
      }
    }
    printf("%s\n", f ? "Yes" : "No");
  }
  return 0;
}
