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