#include <bits/stdc++.h>
using namespace std;
long long A, B, C, D;
vector<long long> G;
bool Check(long long x) {
  for (int i = 0; i < G.size(); i++)
    if (G[i] == x) return 0;
  return 1;
}
int main() {
  int T;
  scanf("%d", &T);
  for (int time = 1; time <= T; time++) {
    bool f = 0;
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    if (A < B || D < B) f = 1;
    for (int k = 0; k <= 10000; k++) {
      long long r = A + D * k;
      long long d = r % B;
      if (d > C || f) {
        printf("No\n");
        f = 1;
        break;
      }
      if (!Check(d) || f) break;
      G.push_back(d);
    }
    if (!f) printf("Yes\n");
    G.clear();
  }
}
