#include <bits/stdc++.h>
using namespace std;
long long A, B, C, D;
bool check(long long a, long long b, long long c, long long d) {
  int t = 1000000;
  long long now;
  if (A <= C)
    now = A - B;
  else
    now = min((A - C) % B + C, A - B);
  if (now < 0) return 0;
  while (t--) {
    if (now <= c) now += d;
    long long h = (now - c) % b + c;
    now = min(h, now - b);
    if (now < 0) return 0;
  }
  return 1;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    if (!check(A, B, C, D)) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }
}
