#include <bits/stdc++.h>
using namespace std;
long long f(long long A, long long B, long long C) {
  long long t = A;
  A %= B;
  C = min(C, t);
  if (C > A) A += (C - A) - (C - A) % B;
  return A;
}
int main() {
  long long A, B, C, D;
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
    set<long long> s;
    bool ok;
    while (1) {
      if (A < B) {
        ok = 0;
        break;
      } else
        A -= B;
      if (C >= B) {
        ok = 1;
        break;
      }
      A = f(A, B, C);
      if (s.count(A)) {
        ok = 1;
        break;
      } else
        s.insert(A);
      if (A <= C) A += D;
    }
    if (ok)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
