#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  vector<int> A(T), B(T), C(T), D(T);
  for (int i = 0; i < T; i++) {
    cin >> A.at(i);
    cin >> B.at(i);
    cin >> C.at(i);
    cin >> D.at(i);
  }
  int a, b, c, d;
  for (int i = 0; i < T; i++) {
    a = A.at(i);
    b = B.at(i);
    c = C.at(i);
    d = D.at(i);
    for (int j = 0; j < a; j++) {
      a = a - b;
      if (a <= 0) {
        cout << "No" << endl;
        break;
      }
      if (a <= c) {
        a = a + d;
      }
      if (a == A.at(i)) {
        cout << "Yes" << endl;
        break;
      }
    }
  }
}
