#include <bits/stdc++.h>
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  long long n, a, b, c, d, e;
  scanf("%lld", &n);
  while (n--) {
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    if (a < b) goto NO;
    if (d < b) goto NO;
    if (c >= b) goto YES;
    if (c >= a) goto YES;
    e = (a - c) % gcd(d, b);
    if (gcd(d, b) == 1 && (b - c) > 1) goto NO;
    if (e && e <= (b - c)) goto NO;
  YES:;
    printf("Yes\n");
    continue;
  NO:;
    printf("No\n");
    continue;
  }
  return 0;
}
