#include <bits/stdc++.h>
using namespace std;
int T;
long long a, b, c, d;
long long Min, Max;
int main() {
  scanf("%d", &T);
  while (T--) {
    Min = max(0LL, b - 1LL);
    Max = 0;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b)
      printf("No\n");
    else {
      a %= b;
      Min = min(Min, a);
      Max = max(Max, a);
      int tot = 300000;
      long long x = d % b;
      if (x != 0LL) {
        while (tot--) {
          long long tmp = (b - a - 1LL) / x;
          a += tmp * x;
          a %= b;
          Max = max(Max, a);
          Min = max(Max, a);
          a = (a + x) % b;
          Min = min(Min, a);
          Max = max(Max, a);
        }
      }
      if (Min + d < b || Max > c)
        printf("No\n");
      else
        printf("Yes\n");
    }
  }
}
