#include <bits/stdc++.h>
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long a, b, c, d, s = 0;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a <= 10000000 && b <= 10000000 && c <= 10000000 && d <= 10000000) {
      do {
        a -= b;
        if (a < 0) break;
        if (a <= c) a += d;
      } while (a > 0 && s++ < 5000000);
      if (a > 0)
        printf("Yes\n");
      else
        printf("No\n");
    } else {
      if (c + d >= a)
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
  return 0;
}
