#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 && temp < b) {
      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;
    }
    r1 = r1 * fac;
    l1 = l1 * fac;
    if (r1 - l1 > fac) {
      cout << "No" << endl;
      continue;
    }
    if (r1 - l1 == fac) {
      if (l1 + fac < r) {
        cout << "No" << endl;
        continue;
      }
    }
    cout << "Yes" << endl;
    ;
  }
  return 0;
}
