#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long tmp;
  while (b) {
    tmp = a;
    a = b, b = tmp % b;
  }
  return a;
}
int main() {
  long long A, B, C, D;
  int tm;
  scanf("%d", &tm);
  while (tm--) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    bool f = 1;
    if (A < B)
      f = 0;
    else if (D < B)
      f = 0;
    else if (C >= B - 1)
      ;
    else {
      long long E = gcd(B, D);
      for (long long i = A - B + 1; i < A - C; i++)
        if (i % E == 0) {
          f = 0;
          break;
        }
    }
    if (f)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
