#include <bits/stdc++.h>
using namespace std;
constexpr long long int INF = std::numeric_limits<long long int>::max();
long long int n;
long long int A, B, C, D;
void print_no() { cout << "No" << endl; }
void print_yes() { cout << "Yes" << endl; }
void solve() {
  set<long long int> history;
  while (true) {
    if (A < B) {
      print_no();
      return;
    }
    if (history.count(A)) {
      print_yes();
      return;
    }
    history.insert(A);
    if (A <= C) {
      A -= B;
    } else {
      long long int k = (A - C) / B;
      if ((A - C) % B != 0) {
        k++;
      }
      A -= k * B;
      if (A < 0) {
        print_no();
        return;
      }
    }
    A += D;
  }
}
signed main() {
  long long int n;
  cin >> n;
  while (n--) {
    cin >> A >> B >> C >> D;
    solve();
  }
  return 0;
}
