#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  long long int A, B, C, D;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    long long int a = B - C;
    long long int d = D % B;
    long long int g = (A - C) % B;
    if (g == 0) g = B;
    if (B > D) {
      cout << "No" << endl;
      continue;
    }
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (B <= D and C >= B) {
      cout << "Yes" << endl;
      continue;
    }
    vector<bool> b(B + 1, false);
    while (true) {
      if (g < a) {
        cout << "No" << endl;
        break;
      }
      if (b[g]) {
        cout << "Yes" << endl;
        break;
      }
      b[g] = true;
      g = (g - B + D) % B;
      if (g == 0) g = B;
    }
  }
}
