#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  vector<long long> A(t), B(t), C(t), D(t);
  for (int i = (0); i < (int)(t); i++) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
  }
  for (int i = (0); i < (int)(t); i++) {
    bool yes = true;
    long long a = A[i];
    long long b = B[i];
    long long c = C[i];
    long long d = D[i];
    if (d < b || a < b)
      yes = false;
    else if (a % b > c)
      yes = false;
    else if (d - b == 0) {
      if (a % b <= c)
        yes = 1;
      else
        yes = false;
    } else if (c >= b)
      yes = true;
    else {
      long long rm = (c - (a - b)) % (d - b);
      if (c - rm + (d - b) < b) yes = false;
    }
    cout << (yes ? "Yes" : "No") << endl;
    ;
  }
  return 0;
}
