#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  for (int i = (0); (i) < (t); (i)++) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (d % b == 0) {
      if (a % b >= 0 && a % b <= c) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
      continue;
    }
    if (b < d) {
      long long int tmp = a % b, dmodb = d % b;
      if (c - tmp < 0) {
        cout << "No" << endl;
        continue;
      }
      tmp += dmodb * (int)((c - tmp) / dmodb);
      tmp += dmodb * (int)((c - tmp) / dmodb);
      tmp += dmodb * (int)((c - tmp) / dmodb);
      tmp += dmodb * (int)((c - tmp) / dmodb);
      while (tmp <= c) {
        tmp += dmodb;
      }
      if (tmp < b) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
      continue;
    }
  }
  return 0;
}
