#include <bits/stdc++.h>
using namespace std;
bool bit(int n, int i) { return (n >> i) & 1; }
int ceil(int a, int b) { return ceil(((long double)a) / b); }
int faltu;
const int mod = 1e9 + 7;
const long long inf = 4e18;
const long long ninf = -inf;
const int imax = 2e9 + 100;
int main() {
  time_t t1, t2;
  t1 = clock();
  srand(time(0));
  ios_base::sync_with_stdio(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d or a <= b) {
      cout << "No\n";
    } else if (b < c) {
      cout << "Yes\n";
    } else {
      long long x = a % b;
      bool flag = false;
      for (int it = 0; it < 10000; it++) {
        if (x > c) {
          flag = true;
          break;
        } else {
          x = (x + d) % b;
        }
      }
      cout << (flag ? "No\n" : "Yes\n");
    }
  }
  t2 = clock();
  cerr << "time taken: " << t2 - t1 << endl;
  return 0;
}
