#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int iter = 0; iter < T; iter++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (D - B < 0 || A - B < 0) {
      cout << "No" << endl;
      continue;
    }
    if (B == D) {
      long long k = max((A - C + (B - 1)) / B - 1, 0LL);
      if (A - (k + 1) * B >= 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
      continue;
    }
    long long k = max((A - C + (B - 1)) / B - 1, 0LL);
    long long x = A - (k + 1) * B;
    if (x < 0) {
      cout << "No" << endl;
      continue;
    }
    bool flag = true;
    for (int i = 0; i < 100000; i++) {
      long long t = (C - x) / (D - B) + 1;
      x = x + t * (D - B);
      if (x < B) {
        cout << "No" << endl;
        flag = false;
        break;
      }
      k = max((x - C + (B - 1)) / B - 1, 0LL);
      x = x - (k + 1) * B;
      if (x < 0) {
        cout << "No" << endl;
        flag = false;
        break;
      }
    }
    if (flag) cout << "Yes" << endl;
  }
  return 0;
}
