#include <bits/stdc++.h>
long long MOD = 1e9 + 7;
using namespace std;
int main() {
  int t;
  int ans = 0;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
    } else if (b == d) {
      if (a % b <= c)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (b <= c) {
      cout << "Yes" << endl;
    } else {
      long long cnt = 0;
      long long n = a;
      bool f = true;
      while (cnt < 100000) {
        n %= b;
        n += b * (max(c - n, 0LL) / b);
        if (n > c && n < b) {
          f = false;
          break;
        }
        n += d;
        cnt++;
      }
      if (f)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
  return 0;
}
