#include <bits/stdc++.h>
using namespace std;
long long A, B, C, D;
inline bool jud() {
  unordered_set<long long> us;
  if (D < B || A < B) return false;
  if (C >= B) return true;
  long long E = A % B;
  if (E > C) return false;
  if (D == B) return true;
  while (true) {
    long long k = (A - C) / B + (bool)((A - C) % B);
    A -= B * k;
    if (A < 0) return false;
    if (us.find(A) != us.end()) return true;
    us.insert(A);
    A += D;
  }
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    puts(jud() ? "Yes" : "No");
  }
  return 0;
}
