#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7 + 100;
int main() {
  int i, j;
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (a % b > c) {
      cout << "No" << endl;
      continue;
    }
    if (a % b + d - b < 0 || d - b < 0) {
      cout << "No" << endl;
      continue;
    }
    if (d != b) {
      long long k = (c + 1 - a % b) / (d - b);
      if ((c + 1 - a % b) % (d - b)) k++;
      long long m = (a % b + k * (d - b));
      if (m % b > c || m < b) {
        cout << "No" << endl;
        continue;
      }
    }
    cout << "Yes" << endl;
  }
  return 0;
}
