#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  for (long long i = 0; i < t; ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long f = 1;
    a %= b;
    if (a <= c) a += d;
    for (long long i = 0; i < 500000; ++i) {
      if (a < b) {
        f--;
        break;
      }
      a -= b;
      if (a <= c) a += d;
    }
    if (f)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
