#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int T, i;
  cin >> T;
  long long A, B, C, D;
  for (i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    for (long long j = 0; j < B; j++) {
      if (A < B) {
        cout << "No" << endl;
        break;
      }
      long long q = (A - C - 1) / B + 1;
      A = A - B * q;
      if (D < B) {
        cout << "No" << endl;
        break;
      } else if (A < 0) {
        cout << "No" << endl;
        break;
      } else if (j == B - 1) {
        cout << "Yes" << endl;
      }
      A += D;
    }
  }
}
