#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 1000000007;
int main(void) {
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    set<long long> rem;
    long long stock = A % B;
    bool flag = A < B;
    rem.insert(stock);
    while (!flag) {
      if (stock <= C) stock += D;
      if (stock >= B)
        stock %= B;
      else
        flag = true;
      if (stock > C || stock < 0) {
        flag = true;
        break;
      } else if (rem.find(stock) == rem.end())
        rem.insert(stock);
      else
        break;
    }
    if (!flag)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
