#include <bits/stdc++.h>
using namespace std;
void solve(long long int A, long long int B, long long int C, long long int D) {
  long long int tmpA = A;
  while (1) {
    A -= B;
    if (A < 0) break;
    if (A <= C) A += D;
    if (A == tmpA) {
      printf("Yes\n");
      return;
    }
  }
  printf("No\n");
  return;
}
int main() {
  int T;
  long long int A, B, C, D;
  cin >> T;
  for (int i = 0; i < T; ++i) {
    cin >> A >> B >> C >> D;
    solve(A, B, C, D);
  }
  return 0;
}
