#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 || d < b || a % b > c) {
      printf("No\n");
      continue;
    }
    if (b < c || d % b == 0) {
      printf("Yes\n");
      continue;
    }
    long long x = a % b, y = (d - b) % b;
    if ((((c + 1 - x) % y + b - c - 2) >= y || (c + 1 - x) % y == 0) &&
        b - c > 1)
      printf("No\n");
    else
      printf("Yes\n");
  }
}
