#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool ok = true;
    for (int i = 0; ok && i < 1000000; ++i) {
      if (a < b) ok = false;
      a %= b;
      if (a <= c) a += d;
    }
    cout << (ok ? "Yes" : "No") << endl;
  }
}
