#include <bits/stdc++.h>
using namespace std;
int T;
long long A, B, C, D;
long long up = 1;
bool calc() {
  if (B > D) return false;
  if (B > A) return false;
  if (B <= C) return true;
  long long a = A % B;
  long long d = D % B;
  long long left = 0;
  long long right = d == 0 ? 0 : ((up - a) / d);
  while (left <= right) {
    long long mid = (left + right) / 2;
    long long target = a + mid * d;
    if (target >= B) {
      right = mid - 1;
    } else if (target <= C) {
      left = mid + 1;
    } else {
      return false;
    }
  }
  return true;
}
int main(void) {
  for (int i = 0; i < 18; i++) up *= 10;
  up += 1;
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    printf("%s\n", calc() ? "Yes" : "No");
  }
  return 0;
}
