#include <bits/stdc++.h>
long long nextday(long long a, long long b, long long c, long long d) {
  if (a < b)
    return a - b;
  else if (a % b <= c)
    return a % b + d;
  else
    return a % b - b;
}
long long gcd(long long a, long long b) {
  if (a < b)
    return gcd(b, a);
  else if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
int main() {
  int t;
  long long a, b, c, d, e;
  bool flag;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (d < b || a < b)
      flag = false;
    else if (c >= b)
      flag = true;
    else if (d % b == 0)
      flag = (nextday(a, b, c, d) >= 0);
    else {
      a = nextday(a, b, c, d);
      e = nextday(a, b, c, d);
      int j = 0;
      while (e != a && e >= 0 && j < 300000) e = nextday(e, b, c, d);
      flag = (e == a);
    }
    if (flag)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
