#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
map<long long, int> mp;
inline bool check(long long M) { return a - M * b > c; }
inline bool solve() {
  if (a < b || d < b) return 0;
  if (c >= b) return 1;
  mp.clear();
  for (int cnt = 1; cnt <= 10000; ++cnt) {
    long long L = 0, R = a / b;
    while (L < R) {
      long long M = (L + R + 1) >> 1;
      if (check(M))
        L = M;
      else
        R = M - 1;
    }
    a -= (L + 1) * b;
    if (a < 0)
      return 0;
    else
      a += d;
    if (mp.count(a))
      return 1;
    else
      ++mp[a];
  }
  return 1;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    puts(solve() ? "Yes" : "No");
  }
  return 0;
}
