#include <bits/stdc++.h>
using namespace std;
int n;
long long a, b, c, d;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  scanf("%d", &n);
  while (n--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b) {
      printf("No\n");
      continue;
    }
    if (b > d) {
      printf("No\n");
      continue;
    }
    if (c + 1 >= b) {
      printf("Yes\n");
      continue;
    }
    long long g = gcd(b, d);
    if ((a - c - 1ll) / g - (a - b - 1) / g > 0)
      printf("No\n");
    else
      printf("Yes\n");
  }
}
