#include <bits/stdc++.h>
using namespace std;
int T;
bool tag;
long long a, b, c, d, now, x;
map<long long, bool> mp;
int main() {
  int i;
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b) {
      printf("No\n");
      continue;
    }
    mp.clear();
    now = a;
    tag = 1;
    mp[now] = 1;
    for (i = 1; i <= 10000; i++) {
      x = max((now - c + b - 1) / b, 1ll);
      now -= x * b;
      if (now < 0) {
        tag = 0;
        break;
      }
      if (now <= c) now += d;
      if (now < b) {
        tag = 0;
        break;
      }
      if (mp[now]) break;
      mp[now] = 1;
    }
    if (tag)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
