#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  scanf("%d", &T);
  for (int i_test = (1); i_test <= (T); ++i_test) {
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (d < b || a < b) {
      puts("No");
      continue;
    }
    if (c >= b) {
      puts("Yes");
      continue;
    }
    if (a % b > c) {
      puts("No");
      continue;
    }
    if (d % b == 0) {
      puts("Yes");
      continue;
    }
    long long tmp = (b - a % b);
    d %= b;
    if (tmp % d == 0)
      tmp = (tmp / d - 1) * d;
    else
      tmp = (tmp / d) * d;
    if (tmp + a % b > c)
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
