#include <bits/stdc++.h>
using namespace std;
long long T;
long long steps;
long long solve(long long a, long long b, long long c, long long d) {
  if (steps > 100010) {
    return 1;
  }
  if (a < b) return 0;
  steps += 1;
  long long hm = (a - c - 1) / b;
  hm = max(hm, 0LL);
  long long aa = a - hm * b;
  if (aa < b) return 0;
  return solve(aa - b + d, b, c, d);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> T;
  while (T--) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    steps = 0;
    long long ans = solve(A, B, C, D);
    ans == 1 ? cout << "Yes\n" : cout << "No\n";
  }
  return 0;
}
