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