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