#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (x < y) swap(x, y);
  if (!y) return x;
  return gcd(y, x % y);
}
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < T; ++i) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (!(D % B)) {
      if (A % B <= C)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
      continue;
    }
    long long d = D % B;
    if ((C - A % B) / d == (B - A % B - 1) / d &&
        ((A % B) % d + C - C % B) / d * d + C - C % B + D >= B)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
