#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int t;
  cin >> t;
  unsigned long int a, b, c, d;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    int counter = 0;
    if (a < b) {
      cout << "No" << endl;
      goto fin;
    }
    if (b > d) {
      cout << "No" << endl;
      goto fin;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      goto fin;
    }
    while (counter < 10000) {
      a = a % b;
      if (a > c) {
        cout << "No" << endl;
        goto fin;
      }
      if (a <= c) a += d;
      counter++;
    }
    if (counter == 10000) cout << "Yes" << endl;
  fin:
    continue;
  }
  return 0;
}
