#include <bits/stdc++.h>
using namespace std;
int T;
long long A, B, C, D, g;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  for (scanf("%d", &T); T--;) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    if (A < B || D < B)
      puts("No");
    else if (B < C)
      puts("Yes");
    else
      g = gcd(B, D), puts((A - B) / g == (A - C - 1) / g ? "Yes" : "No");
  }
  return 0;
}
