#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  for (int i = 0; i < (T); i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    long long hoz = A - D;
    long long hozA = A;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (B == 1) {
      cout << "Yes" << endl;
      continue;
    }
    while (true) {
      A %= B;
      if (C < hoz) {
        cout << "No" << endl;
        break;
      }
      if (A == hoz) {
        cout << "Yes" << endl;
        break;
      }
      if (A <= C) {
        A += D;
        if (C == 1) {
          cout << "Yes" << endl;
          break;
        }
      }
      if (A < B) {
        cout << "No" << endl;
        break;
      }
    }
  }
}
