#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 2e6 + 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;
  }
  long long delta = d - b;
  if (c >= a && delta != 0) {
    long long l = (c + 1 - a + delta - 1) / delta;
    a += l * delta;
  }
  if (b == d) {
    if (c >= a) {
      printf("Yes\n");
      return;
    }
    long long nx = (a - c) % b + c;
    if ((a - c) % b == 0) nx += b;
    if (nx - b < 0)
      printf("No\n");
    else
      printf("Yes\n");
    return;
  }
  long long nx = (a - c) % b + c;
  if ((a - c) % b == 0) nx += b;
  if (nx - b < 0) {
    printf("No\n");
    return;
  }
  if (b <= c + 1) {
    printf("Yes\n");
    return;
  }
  if (b - 1 >= nx && nx >= c + 1) {
    printf("No\n");
    return;
  }
  long long cur = a;
  if (cur % b >= c + 1) {
    printf("No\n");
    return;
  }
  a %= b, delta %= b;
  long long tmp = c + 1;
  for (int i = 0; i <= tmp; i++) {
    cur = (cur + delta) % b;
    if (cur >= tmp) {
      printf("No\n");
      return;
    }
  }
  printf("Yes\n");
}
int main() {
  int t;
  scanf("%d", &(t));
  while (t--) solve();
  return 0;
}
