#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 a, b, c, d, t;
int main() {
  scanf("%lld", &t);
  for (int i = 1; i <= t; i++) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b || d < b) {
      printf("No\n");
      continue;
    }
    long long x = gcd(b, d), tmp, y = c - a;
    if (y % d == 0)
      tmp = y / x + 1;
    else
      tmp = y / x;
    if (tmp > 0) tmp++;
    if (y < tmp * x && tmp * x < (b - a))
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
