#include <bits/stdc++.h>
int comp(const void* a, const void* b) { return *(int*)a - *(int*)b; }
int main(void) {
  int t, i;
  long long a, b, c, d, now;
  scanf("%d\n", &t);
  while (t-- > 0) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    now = a;
    while (1) {
      if (b > now) {
        puts("No");
        break;
      } else {
        now -= (now - c + b - 1) / b * b;
        if (now < 0) now += b;
        if (now <= c) now += d;
      }
      if (now == a) {
        puts("Yes");
        break;
      }
    }
  }
  return 0;
}
