#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  int t = 0;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long zaiko = a;
    bool flag = true;
    if (a < b) flag = false;
    if (d < b) flag = false;
    long long n = (d % b == 0) ? 0 : c / (d % b) - 1;
    long long m = (d % b == 0) ? 0 : b / (d % b) + 1;
    long long l = 0;
    if (c < a % b && b > a % b) flag = false;
    long long lo = n;
    long long hi = m;
    l = (lo + hi) / 2;
    long long dif = d % b;
    long long err = a % b;
    if (dif != 0) {
      do {
        if (c < err % dif + l * dif && b > err % dif + l * dif) {
          flag = false;
          break;
        } else {
          bool ba = false;
          if (c >= l * (d % b)) {
            lo = l + 1;
            ba = true;
          }
          if (b <= l * (d % b)) {
            hi = l - ((ba) ? 0 : 1);
          }
          l = (lo + hi) / 2;
        }
      } while (lo < hi && d % b != 0);
    }
    if (flag) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
