#include <bits/stdc++.h>
long long int min(long long int x, long long int y) {
  if (x < y) return x;
  return y;
}
int main() {
  int t, flag = 0;
  long long int a, b, c, d, ab, haba, md;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    flag = 1;
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    if (a < b) flag = 0;
    ab = a - b;
    a = a % b;
    a = min(a + ((c - a) / b * b), ab);
    if (a <= c && a + d < b) flag = 0;
    if (a > c && a < b) flag = 0;
    md = d % b;
    haba = b - 1 - c;
    if (b > c + 1 && md != 0 &&
        ((b % md != 0 && b % (b % md) == 0) || (c + 1 - a) % md <= haba - 1)) {
      flag = 0;
    }
    if (d < b) {
      flag = 0;
    }
    if (flag)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
