#include <bits/stdc++.h>
using namespace std;
double pi = 3.141592653589793;
signed main() {
  long long t, a, b, c, d;
  cin >> t;
  for (long long i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (b > d || a < b) {
      cout << "No" << endl;
      continue;
    }
    long long s = a % b;
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    if (s > c) {
      cout << "No" << endl;
      continue;
    }
    long long inc = d % b;
    long long h = (s - c + b) % b;
    bool hj = 0;
    for (long long i = 0; i < 10000; i++) {
      long long j = (h + (i * inc) % b) % b;
      if (c < j && j < b) {
        hj = 1;
        cout << "No" << endl;
        break;
      }
    }
    if (hj == 0) cout << "Yes" << endl;
  }
  return 0;
}
