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