#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  int T;
  cin >> T;
  long long a, b, c, d;
  while (T--) {
    cin >> a >> b >> c >> d;
    if (b > d || b > a) {
      cout << "No" << endl;
      continue;
    }
    while (a > c) a -= b;
    if (a < 0) {
      cout << "No" << endl;
      continue;
    }
    if (gcd(b, d) + c >= b)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
