#include <bits/stdc++.h>
using namespace std;
const int SIZE = 500010;
const int INF = 2147483640;
const double eps = 1e-8;
inline void RD(int &x) {
  x = 0;
  char c;
  c = getchar();
  bool flag = 0;
  if (c == '-') flag = 1;
  while (c < '0' || c > '9') {
    if (c == '-') {
      flag = 1;
    }
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + c - '0', c = getchar();
}
long long t;
long long a, b, c, d;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
bool pd(long long a, long long b, long long c, long long d) {
  if (a < b) return false;
  long long r = a / b + 2;
  long long l = 0;
  long long mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if ((a - mid * b) <= c)
      r = mid - 1;
    else
      l = mid + 1;
  }
  long long num = a - b * l;
  long long gc;
  gc = gcd(num, b);
  gc = gcd(gc, c);
  gc = gcd(c, d);
  if (num < 0) return false;
  if (b > d) return false;
  if (c + gc < b) return false;
  return true;
}
int main(int argc, char const *argv[]) {
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    if (pd(a, b, c, d))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
