#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000, MAX = 400000;
int T;
long long A, B, C, D;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
    if (A < B)
      puts("No");
    else if (B < C && B < D)
      puts("Yes");
    else if (B < C && B > D)
      puts("No");
    else if (B > C && B > D)
      puts("No");
    else if (B > C && B < D) {
      long long prev = 0;
      bool ok = true;
      for (int i = 1; i <= MAX; ++i) {
        if (A < B || (C < A % B && B > C)) {
          ok = false;
          break;
        } else {
          A = D + A % B;
          if (A < prev) {
            ok = false;
            break;
          } else
            prev = A;
        }
      }
      puts(ok ? "Yes" : "No");
    }
  }
  return 0;
}
