#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    ll s = a % b;
    if (d < b) {
      cout << "No" << endl;
      continue;
    }
    ll pl = d % b;
    if (pl == 0) {
      if (s > c) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
      continue;
    }
    ll m = s + ((b - s) / pl) * pl;
    if (m == b) m = max(s, m - pl);
    if (m > c)
      cout << "No" << endl;
    else {
      cout << "Yes" << endl;
    }
  }
}
