#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e6 + 5;
const double eps = 1e-9;
using namespace std;
void solve() {
  long long a, b, c, d;
  scanf("%lld", &(a)), scanf("%lld", &(b)), scanf("%lld", &(c)),
      scanf("%lld", &(d));
  if (d < b || a < b) {
    printf("No\n");
    return;
  }
  if (b == d) {
    long long k = (a - c) / b;
    if ((a - c) % b == 0) k--;
    long long nx = a - k * b;
    if (nx - b < 0)
      printf("No\n");
    else
      printf("Yes\n");
    return;
  }
  long long k = (a - c) / b;
  if ((a - c) % b == 0) k--;
  long long nx = a - k * b;
  if (nx - b < 0) {
    printf("No\n");
    return;
  }
  if (b <= c + 1) {
    printf("Yes\n");
    return;
  }
  long long del = d - b;
  if (c + del <= b - 1) {
    printf("No\n");
    return;
  }
  long long mx = b - 1 - del;
  if (mx < 0) {
    printf("Yes\n");
    return;
  }
  long long u = b - del - 1;
  long long lo = c - del + 1;
  if (lo > u) {
    printf("No\n");
    return;
  }
  long long tmp = (a - c + b - 1) / b;
  nx = a - tmp * b;
  long long al = (lo - nx + del - 1) / del;
  long long bl = (u - nx) / del;
  if (al <= bl)
    printf("No\n");
  else
    printf("Yes\n");
}
int main() {
  int t;
  scanf("%d", &(t));
  while (t--) solve();
  return 0;
}
