#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  vector<long long> A(T), B(T), C(T), D(T);
  for (int i = 0; i < (T); i++) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
  }
  for (int i = 0; i < (T); i++) {
    bool yes = true;
    if (A[i] < B[i])
      yes = false;
    else if (A[i] % B[i] > C[i])
      yes = false;
    else if (B[i] > D[i])
      yes = false;
    else {
      for (int j = 0; j < (B[i]); j++) {
        if ((A[i] + j * D[i]) % B[i] > C[i]) {
          yes = false;
          break;
        }
      }
    }
    if (yes)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
