#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  long long a[400], b[400], c[400], d[400];
  cin >> t;
  for (int i = (0); i < (t); i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (int i = (0); i < (t); i++) {
    bool ans;
    if (a[i] < b[i] || b[i] > d[i]) {
      ans = false;
    } else {
      long long hoge = a[i];
      if (a[i] > c[i]) {
        hoge -= ceil((long double)(a[i] - c[i]) / (long double)(b[i])) * b[i];
      } else {
        hoge +=
            floor((long double)(c[i] + 1 - a[i]) / (long double)(b[i])) * b[i];
      }
      if (hoge < 0) {
        ans = false;
      } else {
        if (d[i] % b[i] == 0) {
          ans = true;
        } else {
          hoge += ceil((long double)(c[i] + 1 - hoge) /
                       (long double)(d[i] % b[i])) *
                  (d[i] % b[i]);
          if (hoge < b[i]) {
            ans = false;
          } else {
            ans = true;
          }
        }
      }
    }
    if (ans) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
