#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  int cnt;
  long A, B, C, D, sum;
  cin >> T;
  for (int i = 0; i < T; i++) {
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;
    sum = A;
    cnt = 0;
    while (true) {
      if ((sum - B) < 0) {
        cout << "No" << endl;
        break;
      } else {
        sum = sum % B;
      }
      if (sum <= C) {
        sum += D;
      }
      cnt++;
      if (cnt > 2014748) {
        cout << "Yes" << endl;
        break;
      }
    }
  }
}
