#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  int T;
  cin >> T;
  long long A, B, C, D;
  const string answer[] = {"No", "Yes"};
  const auto valid = [](long long A, long long B, long long C, long long D) {
    if (A < B or D < B) return false;
    for (set<long long> stock; A >= B; stock.insert(A)) {
      long long k = (A - C) / B;
      if (k > 0)
        A -= k * B;
      else
        A -= B;
      if (A <= C) A += D;
      if (stock.find(A) != stock.end()) return true;
    }
    return false;
  };
  for (int i = 0; i < T; i++)
    cin >> A >> B >> C >> D, cout << answer[valid(A, B, C, D)] << endl;
}
