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