#include <bits/stdc++.h>
int main() {
  long long int all_cans = 0;
  int T = 0;
  scanf("%d", &T);
  long long int data[T][4];
  char answer[T][4];
  int i, j, k;
  for (i = 0; i < T; i++)
    scanf("%lld%lld%lld%lld", &data[i][0], &data[i][1], &data[i][2],
          &data[i][3]);
  for (j = 0; j < T; j++) {
    all_cans = data[j][0];
    long long int first_cans = data[j][0];
    while ((all_cans -= data[j][1]) > 0) {
      if (all_cans <= data[j][2]) all_cans += data[j][3];
      if (all_cans == first_cans) break;
    }
    if (all_cans < 0)
      strcpy(answer[j], "No");
    else
      strcpy(answer[j], "Yes");
    all_cans = 0;
  }
  for (k = 0; k < T; k++) printf("%s\n", answer[k]);
}
