#include <bits/stdc++.h>
using namespace std;
const int prime[15] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};
inline void ln() { cout << '\n'; }
template <class T, class... A>
inline void ln(const T& first, const A&... rest) {
  cout << first;
  ln(rest...);
}
template <class... A>
inline void ln(const A&... rest) {
  ln(rest...);
}
template <class T>
inline void so(T t) {
  cout << t << '\n';
}
template <class T, class... A>
inline void so(T first, A... rest) {
  cout << first << ' ';
  so(move(rest)...);
}
inline void op() {}
template <class T, class... A>
inline void op(const T& first, const A&... rest) {
  cout << first;
  op(rest...);
}
inline void in() {}
template <class T, class... A>
inline void in(T&& first, A&&... rest) {
  cin >> first;
  in(move(rest)...);
}
inline long long gcd(long long a, long long b) {
  long long c;
  while (a) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
inline bool isp(long long a) {
  if (a < 48) {
    for (long long i = (0); i < (15); ++i)
      if (prime[i] == a) return 1;
  } else if (a < 2809)
    return gcd(614889782588491410, a) == 1;
  else
    ln("Error");
  return 0;
}
inline long long mx(long long a, long long b) { return (a > b ? a : b); }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a, b, c, d, e, f, g, h, i, j, k, l, m, n;
  in(n);
  for (long long i = (0); i < (n); ++i) {
    in(a, b, c, d);
    e = 1;
    f = a;
    if (d < b) {
      ln("No");
      continue;
    }
    for (long long j = (1); j < (1230000); ++j) {
      if (f - b <= c) {
        g = (f - b);
        if (g < 0) {
          ln("No");
          e = 0;
          break;
        }
        f = g + d;
      } else {
        g = (f - ((f - c + b - 1) / b) * b);
        if (g < 0) {
          ln("No");
          e = 0;
          break;
        }
        f = g + d;
      }
    }
    if (e) ln("Yes");
  }
}
