#include <bits/stdc++.h>
const int INF = (~0U) >> 2;
const long long INFLL = (~0ULL) >> 2;
int t;
long long a, b, c, d;
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    for (int i = 1; i <= 1000000; i++) {
      a -= b;
      if (a < 0) goto fail;
      if (a <= c) a += d;
      long long dis = a - c;
      long long times = std::max(dis / b, 0LL);
      a -= b * times;
      if (a < 0) goto fail;
      if (a <= c) a += d;
      a -= b;
      if (a < 0) goto fail;
      if (a <= c) a += d;
    }
    puts("Yes");
    continue;
  fail:
    puts("No");
  }
  return 0;
}
