#include <bits/stdc++.h>
using namespace std;
const int MAX_T = 300 + 1;
int T;
long long A[MAX_T], B[MAX_T], C[MAX_T], D[MAX_T];
const string yes = "Yes", no = "No";
unordered_set<long long> S;
string f(long long x, long long B, long long C, long long D) {
  if (S.count(x)) return yes;
  S.emplace(x);
  if (x < B) return no;
  long long p = max((x - C - 1) / B, 0LL);
  long long y = x - B * p;
  if (y < B) return no;
  y = x - B * (p + 1);
  assert(y <= C);
  y += D;
  if (x == y) return yes;
  return f(y, B, C, D);
}
string solve(long long A, long long B, long long C, long long D) {
  S.clear();
  if (A < B) return no;
  if (D < B) return no;
  if (B <= C) return yes;
  return f(A, B, C, D);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> T;
  for (int i = 0; i < (T); ++i) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
  }
  for (int i = 0; i < (T); ++i) cout << solve(A[i], B[i], C[i], D[i]) << endl;
  ;
  return 0;
}
