#include <bits/stdc++.h>
using namespace std;
long long A, B, C, D;
map<int, bool> ff;
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++) {
      int r = A + D * k;
      int d = r % B;
      if (d > C || f) {
        printf("No");
        f = 1;
        break;
      }
      if (ff[d] || f) break;
      ff[d] = 1;
    }
    if (!f) printf("Yes");
    ff.clear();
  }
}
