#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000, MAX = 400000;
int T;
long long A, B, C, D;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
    if (A < B) {
      puts("No");
      continue;
    }
    bool ok = true;
    for (int i = 1; i <= MAX; ++i) {
      if (A < B || (C < A % B && B > C)) {
        ok = false;
        break;
      } else
        A = D + A % B;
    }
    puts(ok ? "Yes" : "No");
  }
  return 0;
}
