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