#include <bits/stdc++.h>
using namespace std;
long long n, a, b, c, d;
int main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) {
    long long f = 0;
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    for (long long j = 1; j <= 10000; j++) {
      if (a < b) {
        f = 1;
        break;
      }
      a %= b;
      if (a <= c) a += d;
    }
    if (f)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
