#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;
constexpr int MOD = 1000000007;
constexpr long long int INF = 50000000000000000;
constexpr long long int SIZE = 100010;
long long int N, A, B, C, D;
long long int ans = 0, sum = 0, wa = 0;
long long int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> N;
  for (int i = 0; i < signed(N); i++) {
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "No" << endl;
      continue;
    }
    cout << (B - gcd(B, D) + A % gcd(B, D) <= C ? "Yes" : "No") << endl;
  }
  return 0;
}
