#include <bits/stdc++.h>
using namespace std;
int T;
long long A, B, C, D;
long long up = 1;
bool calc() {
  set<long long> as;
  long long a = A;
  while (true) {
    if (a < B) return false;
    as.insert(a);
    long long c = min(a - B, C);
    long long m = (a - c - 1) / B + 1;
    a = a - m * B;
    if (a < 0) return false;
    a += D;
    if (as.find(a) != as.end()) return true;
  }
  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;
}
