#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b > a)
    return gcd(b, a);
  else if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
signed main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long T;
  cin >> T;
  while (T--) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (((gcd(B, D) - A % gcd(B, D) % gcd(B, D)) + C - B) >= 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
