#include <bits/stdc++.h>
using namespace std;
int t;
long long a[300], b[300], c[300], d[300];
bool boo(long long a, long long b, long long c, long long d) {
  long long n = a % b;
  for (int i = 0; i < 100000; i++) {
    if (c < n && c < b) {
      return false;
    }
    n += (d % b);
    n %= b;
  }
  return true;
}
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] || b[i] > d[i] || (a[i] % b[i]) > c[i] ||
        (b[i] != d[i] && !boo(a[i], b[i], c[i], d[i]))) {
      cout << "No" << endl;
    } else
      cout << "Yes" << endl;
  }
  return 0;
}
