#include <bits/stdc++.h>
int T;
long long K, X0, XM, N;
inline long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
inline void solve() {
  if (X0 < K) {
    puts("No");
    return;
  }
  if (X0 < XM && K > N) {
    puts("No");
    return;
  }
  if (X0 < XM && K == N) {
    puts("Yes");
    return;
  }
  long long g = gcd(K, N);
  long long t = (X0 - XM) / g;
  if (X0 < XM) t = (X0 - XM + 1) / g - 1;
  long long mn = X0 - t * g;
  if (K >= XM) {
    if (mn - K + N < K) {
      puts("No");
      return;
    } else if (mn >= K) {
      puts("Yes");
      return;
    } else {
      puts("No");
      return;
    }
  } else {
    if (K <= N) {
      puts("Yes");
      return;
    } else if (mn - K + N >= XM) {
      puts("Yes");
      return;
    } else {
      puts("No");
      return;
    }
  }
}
int main() {
  scanf("%d", &T);
  for (int t = 1; t <= T; ++t) {
    scanf("%lld %lld %lld %lld", &K, &X0, &XM, &N);
    solve();
  }
  return 0;
}
