#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const string no = "No", yes = "Yes";
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < (T); i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B)
      cout << no << endl;
    else if (B == D) {
      long long t = (A - C) / B + ((A - C) % B == 0 ? 0 : 1);
      if (A - B * t >= 0)
        cout << yes << endl;
      else
        cout << no << endl;
    } else if (B > D)
      cout << no << endl;
    else {
      int cnt = 1010101;
      bool flag = 0;
      for (int j = 0; j < (cnt); j++) {
        long long t = (A - C) / B + ((A - C) % B == 0 ? 0 : 1);
        A -= B * t;
        if (A < 0) {
          flag = 1;
          break;
        }
        A += D;
      }
      if (flag)
        cout << no << endl;
      else
        cout << yes << endl;
    }
  }
  return 0;
}
