#include <bits/stdc++.h>
using namespace std;
int doo(long long a, long long b, long long c, long long d) {
  a = a % b;
  while (a <= c) {
    a += b;
  }
  long long a1 = a;
  int count = 0;
  while (a >= b) {
    count++;
    if (count >= 10000) return 1;
    a -= b;
    if (a <= c) a += d;
    if (a1 == a) return 1;
  }
  return 0;
}
int main() {
  long long a, b, c, d;
  int n, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (doo(a, b, c, d))
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
