#include <bits/stdc++.h>
using namespace std;
int Q;
long long a, b, c, d, e;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  scanf("%d", &Q);
  while (Q--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (b > d) {
      puts("No");
      continue;
    }
    if (a < b) {
      puts("No");
      continue;
    }
    e = gcd(b, d);
    if ((a - c) % e == 0)
      a -= ((a - c) / e - 1) * e;
    else
      a -= (a - c) / e * e;
    a -= b;
    if (a < 0)
      puts("NO");
    else
      puts("Yes");
  }
  return 0;
}
