#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t, a, b, c, d;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    bool ok = 1;
    for (int i = 0; i < 10000; i++) {
      if (a < b) {
        cout << "No" << endl;
        ok = 0;
        break;
      }
      if ((a % b) + b <= c) {
        a %= b;
        a += b;
      } else
        a %= b;
      if (a <= c) a += d;
    }
    if (ok) cout << "Yes" << endl;
  }
}
