#include <bits/stdc++.h>
int main() {
  int t = 0;
  scanf("%d\n", &t);
  long long int a[t], b[t], c[t], d[t];
  int i = 0;
  int j = 0;
  for (i = 0; i < t; i++) {
    scanf("%lld %lld %lld %lld", &a[i], &b[i], &c[i], &d[i]);
  }
  int tmp = 0;
  int no = 0;
  for (i = 0; i < t; i++) {
    no = 0;
    if (a[i] < b[i] || d[i] < b[i]) {
      printf("No\n");
      continue;
    }
    if (b[i] - 1 <= c[i]) {
      printf("Yes\n");
      continue;
    }
    tmp = a[i];
    for (j = 0; j < b[i]; j++) {
      if (c[i] < tmp % b[i]) {
        printf("No\n");
        no = 1;
        break;
      }
      tmp = tmp + d[i];
      if (tmp % b[i] == tmp % a[i]) {
        break;
      }
    }
    if (no == 0) {
      printf("Yes\n");
    }
  }
  return 0;
}
