#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  for (long long cn = 0; cn < t; cn++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d || a < b || ((a % b) > c)) {
      cout << "No" << endl;
      continue;
      ;
    }
    if (b == d) {
      if (a % b <= c)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
      continue;
    }
    if (b <= c + 1 || c + d == a) {
      cout << "Yes" << endl;
      continue;
    }
    long long f = 0;
    for (long long i = 0; i < 100000; i++) {
      a -= b;
      if (a < 0) {
        f = 1;
        cout << "No" << endl;
        break;
      }
      if (a <= c) a += d;
    }
    if (f) continue;
    cout << "Yes" << endl;
  }
  return 0;
}
