#include <bits/stdc++.h>
using namespace std;
static const long long maxLL = (long long)1 << 62;
static const long long MIN_LL = (long long)1 << 55;
int main() {
  long long T;
  cin >> T;
  for (long long i = 0; i < T; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    map<long long, long long> mp;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    long long cur = a;
    mp[cur]++;
    while (1) {
      if (cur < b) {
        cout << "No" << endl;
        break;
      }
      cur = cur % b;
      if (cur <= c) {
        cur += d;
        if (mp[cur] >= 1) {
          cout << "Yes" << endl;
          break;
        }
        mp[cur]++;
      }
    }
  }
  return 0;
}
