#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
void solve() {
  scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
  if (d < b) {
    printf("No\n");
    return;
  }
  set<long long> u;
  while (u.find(a) == u.end()) {
    u.insert(a);
    long long t = max(1ll, (a - c + b - 1) / b);
    a -= t * b;
    if (a < 0) {
      printf("No\n");
      return;
    }
    a += d;
  }
  if (a < 0) {
    printf("No\n");
  } else {
    printf("Yes\n");
  }
}
int main() {
  int tt;
  scanf("%d", &tt);
  while (tt--) {
    solve();
  }
  return 0;
}
