#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, b, c, d;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (b <= c + 1) {
      cout << "Yes" << endl;
      continue;
    }
    long long ma = a % b, md = d % b;
    if (md == 0) {
      if (ma <= c % b) {
        cout << "Yes" << endl;
        continue;
      } else {
        cout << "No" << endl;
        continue;
      }
    }
    long long e = c + 1 - ma, f = b - 1 - ma;
    long long t = (e / md) * md;
    if (t == e || t + md <= f) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
