#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long t, a[305], b[305], c[305], d[305];
long long x, y, z, n;
int main() {
  scanf("%lld", &t);
  for (int i = 1; i <= t; i++)
    scanf("%lld%lld%lld%lld", &a[i], &b[i], &c[i], &d[i]);
  for (int i = 1; i <= t; i++) {
    long long tmp = gcd(a[i], b[i]);
    tmp = gcd(tmp, c[i]);
    tmp = gcd(tmp, d[i]);
    a[i] /= tmp;
    b[i] /= tmp;
    c[i] /= tmp;
    d[i] /= tmp;
    if (a[i] < b[i] || b[i] > d[i]) {
      printf("No\n");
      continue;
    }
    x = a[i];
    y = b[i];
    z = c[i];
    n = d[i];
    if (c[i] < b[i]) {
      a[i] %= b[i];
      if (a[i] > c[i]) {
        printf("No\n");
        continue;
      }
    }
    if (y <= (z + 1))
      printf("Yes\n");
    else if (n % y == 0)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
