#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long i, j, k, n, ans = 0, t;
  scanf("%lld", &t);
  for (k = 0; k < t; ++k) {
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b) {
      printf("No\n");
      continue;
    }
    set<long long> se;
    char ss = 0;
    while (1) {
      a %= b;
      long long t = (c - a) / b;
      a += t * b;
      if (a > c) {
        printf("No\n");
        ss = 1;
        break;
      }
      t = d - b;
      if (t < 0) {
        printf("No\n");
        ss = 1;
        break;
      }
      long long tm;
      if (t) {
        tm = (c - a) / t + 1;
        a += tm * t;
      } else {
        break;
      }
      if (a < b) {
        printf("No\n");
        ss = 1;
        break;
      }
      if (se.size() && se.find(a) != se.end()) break;
      se.insert(a);
    }
    if (ss) continue;
    printf("Yes\n");
  }
  return 0;
}
