#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void infinityOutput(long long A, long long B, long long C, long long D) {
  long long g = gcd(B, D);
  long long k = B / g;
  bool flag = true;
  while (k >= 0) {
    long long r = A % B;
    if (r > C) {
      flag = false;
      break;
    }
    A = r + D;
    k--;
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
int main() {
  long long T;
  scanf("%lld", &T);
  long long A, B, C, D;
  for (long long i = 0; i < T; i++) {
    scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
    infinityOutput(A, B, C, D);
  }
  return 0;
}
