#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  long long int A[300], B[300], C[300], D[300];
  cin >> T;
  for (int i = 1; i <= T; i++) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
    int a = A[i];
    int b;
    int c = C[i];
    int count = 0;
    while (true) {
      a -= B[i];
      if (a <= c) {
        if (a < 0) {
          cout << "No" << endl;
          break;
        }
        a += D[i];
        count++;
        a -= B[i];
        if (a < 0) {
          cout << "No" << endl;
          break;
        }
      }
      b = (a - C[i]) / B[i];
      a -= B[i] * b;
      if (a == c) a += B[i];
      a -= B[i];
      if (a < 0) {
        cout << "No" << endl;
        break;
      }
      a += D[i];
      count++;
      if (count > 1000) {
        cout << "Yes" << endl;
        break;
      }
    }
  }
  return 0;
}
