#include <bits/stdc++.h>
int gcd(int a, int b) {
  long long int c;
  while (a % b != 0) {
    c = b % a;
    b = a;
    a = c;
  }
  return b;
}
int main(void) {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    long long int a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (b > a || a % b > c || b > d) {
      printf("No\n");
      continue;
    }
    long long int g = gcd(b, d);
    long long int stock = b - g + a % g;
    if (stock > c) {
      printf("No\n");
    } else if (stock <= c) {
      printf("Yes\n");
    }
  }
  return 0;
}
