#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
int T;
ll A[300], B[300], C[300], D[300];
bool solve(ll a, ll b, ll c, ll d) {
  if ((a - b) < 0) return false;
  if (b > d)
    return false;
  else if (b == d) {
    int n = (a - c) / b;
    if (!(b * n == a - c)) ++n;
    if (a - c < 0) n = 1;
    if (a - b * n >= 0)
      return true;
    else
      false;
  } else if (d > b) {
    if (c - b >= 0)
      return true;
    else {
      ll stock = a;
      set<ll> pattern;
      while (1) {
        ll n = (stock - c) / b;
        if (b * n != (stock - c) || n == 0) ++n;
        if (stock - c < 0) n == 1;
        stock -= b * n;
        if (stock < 0) return false;
        if (pattern.find(stock) != pattern.end()) return true;
        pattern.insert(stock);
        stock += d;
        if (stock < b) return false;
      }
    }
  }
}
int main() {
  scanf("%d", &T);
  for (int i = 0; i < T; ++i)
    scanf("%lld%lld%lld%lld", &A[i], &B[i], &C[i], &D[i]);
  for (int i = 0; i < T; ++i) {
    if (solve(A[i], B[i], C[i], D[i]))
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
