#include <bits/stdc++.h>
void judge(long a, long b, long c, long d) {
  if (a < b || d < b) {
    puts("No");
    return;
  }
  a %= b;
  long ao = a;
  for (int i = 0; a != ao || i == 0; i++) {
    if (a <= c) {
      a += d;
    }
    a -= b;
    if (a < 0) {
      puts("No");
      return;
    }
    a %= b;
  }
  puts("Yes");
  return;
}
int main(void) {
  int t;
  scanf("%d", &t);
  long a[t], b[t], c[t], d[t];
  for (int i = 0; i < t; i++) {
    scanf("%ld%ld%ld%ld", &a[i], &b[i], &c[i], &d[i]);
  }
  for (int i = 0; i < t; i++) {
    judge(a[i], b[i], c[i], d[i]);
  }
  return 0;
}
