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