#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;
  if (d > b && c >= b) return true;
  ll stock = a;
  vector<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 (find(pattern.begin(), pattern.end(), stock) != pattern.end())
      return true;
    pattern.push_back(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;
}
