#include <bits/stdc++.h>
int main(void) {
  int t, i;
  unsigned long int a[300], b[300], c[300], d[300];
  unsigned long int min;
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    scanf("%lu %lu %lu %lu", &a[i], &b[i], &c[i], &d[i]);
  }
  for (i = 0; i < t; i++) {
    min = 1000000000000000000;
    while (1) {
      if (a[i] < b[i]) {
        printf("No\n");
        break;
      }
      a[i] -= b[i];
      if (min > a[i]) {
        min = a[i];
      }
      if (min == a[i]) {
        printf("Yes\n");
        break;
      }
      if (a[i] <= c[i]) {
        a[i] += d[i];
      }
    }
  }
  return 0;
}
