#include <bits/stdc++.h>
using namespace std;
int t;
long long a[300], b[300], c[300], d[300];
int main() {
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (int i = 0; i < t; i++) {
    if (a[i] < b[i]) {
      cout << "No" << endl;
      continue;
    }
    if (d[i] < b[i]) {
      cout << "No" << endl;
      continue;
    }
    if (b[i] - c[i] < (long long)2) {
      cout << "Yes" << endl;
      continue;
    }
    long long x;
    if ((a[i] - c[i]) % b[i] == (long long)0) {
      x = c[i];
    } else {
      x = a[i] - ((a[i] - c[i]) / b[i] + (long long)1) * b[i];
    }
    if (x < 0) {
      cout << "No" << endl;
      continue;
    }
    a[i] = x;
    d[i] = d[i] - ((d[i] - c[i]) / b[i] + (long long)1) * b[i];
    if (d[i] == 0) {
      cout << "Yes" << endl;
      continue;
    }
    if (d[i] + c[i] < b[i]) {
      cout << "NO" << endl;
      continue;
    }
    if (b[i] % d[i] == 0 &&
        a[i] + ((c[i] - a[i]) / d[i] + 1) * d[i] > b[i] - 1) {
      cout << "Yes" << endl;
      continue;
    }
    cout << "NO" << endl;
  }
  return 0;
}
