#include <bits/stdc++.h>
using namespace std;
long long gcd(long long m, long long n) {
  if ((0 == m) || (0 == n)) return 0;
  while (m != n) {
    if (m > n)
      m = m - n;
    else
      n = n - m;
  }
  return m;
}
bool num(long long a, long long b, long long c, long long d) {
  if (b > a) return false;
  if (b > d) return false;
  if (c >= b) return true;
  long long g = gcd(b, d);
  if (a - g + (a % g) > c)
    return false;
  else
    return true;
}
signed main() {
  ios::sync_with_stdio(false);
  long long t, a, b, c, d;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (num(a, b, c, d))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
