#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, t, temp, l, r, fac, r1, l1;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  for (int i = 1; i <= t; i++) {
    cin >> a >> b >> c >> d;
    if (b > d || b > a) {
      cout << "No" << endl;
      ;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    temp = a % b;
    l = c - temp;
    r = b - temp;
    if (temp > c) {
      cout << "No" << endl;
      continue;
    }
    fac = d % b;
    if (fac == 0 && temp > c) {
      cout << "No" << endl;
      ;
      continue;
    }
    if (fac == 0) {
      cout << "Yes" << endl;
      continue;
    }
    l1 = l / fac;
    r1 = r / fac;
    if (r1 - l1 >= 2) {
      cout << "No" << endl;
      continue;
    }
    bool flag = false;
    long long diff;
    flag = !(l % fac) && !(r % fac);
    if (!(l % fac) && !(r % fac) && r1 - l1 > 1) {
      cout << "No" << endl;
      continue;
    }
    diff = r - l;
    if (diff / fac && !flag) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
    ;
  }
  return 0;
}
