#include <bits/stdc++.h>
using namespace std;
map<long long, int> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  for (int test = 1; test <= t; test++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (abs(c - b) <= 1 || c > b) {
      cout << "Yes" << endl;
    } else {
      a = a % b;
      d = d % b;
      if (d) {
        long long x = (c - a + d) / d;
        if ((a + d * x) % b > c) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      } else {
        if (a > c) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      }
    }
  }
  return 0;
}
