#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int T;
  long long A, B, C, D;
  cin >> T;
  while (T--) {
    cin >> A >> B >> C >> D;
    if (A < B || D < B)
      cout << "No\n";
    else {
      long long x = A % gcd(B, D);
      if (x >= C - B + 1)
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  }
  return 0;
}
