#include <bits/stdc++.h>
int main(void) {
  int t;
  scanf("%d\n", &t);
  bool no = false;
  for (int i = 0; i < t; i++) {
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    long long s = a;
    do {
      if (a < b || a % b > c) {
        printf("No\n");
        no = true;
        break;
      } else {
        long long s2 = a - b;
        a = a % b;
        while (a <= c && a <= s2) {
          a += b;
        }
        a = a + d - b;
      }
    } while (a % b != s % b || a < s);
    if (no == false) {
      printf("Yes\n");
    }
    no = false;
  }
  return 0;
}
