#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 > a || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    temp = a % b;
    fac = d % b;
    if (fac == 0 && temp > c) {
      cout << "No" << endl;
      ;
      continue;
    }
    if (fac == 0) {
      cout << "Yes" << endl;
      continue;
    }
    c -= temp;
    b -= temp;
    l = c / fac;
    r = b / fac;
    l = l * fac;
    l = l + fac;
    if (l < b) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
