#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;
  bitset<300> query;
  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;
    set<long long> stock;
    while (A >= B) {
      long long k = (A - C) / B;
      if (k > 0)
        A -= k * B;
      else
        A -= B;
      if (stock.find(A) != stock.end())
        return true;
      else
        stock.insert(A);
      if (A <= C) A += D;
    }
    return false;
  };
  for (int i = 0; i < T; i++)
    cin >> A >> B >> C >> D, query[i] = valid(A, B, C, D);
  for (int i = 0; i < T; i++) cout << answer[query[i]] << endl;
}
