#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    bool Is_Found = true;
    long long A, B, C, D;
    scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
    long long Now = A;
    while (Now - B > C) Now -= B;
    for (int i = 1; i <= 15000000; i++) {
      Now -= B;
      if (Now < 0) {
        puts("No");
        Is_Found = false;
        break;
      }
      if (Now <= C) Now += D;
    }
    if (Is_Found) puts("Yes");
  }
  return 0;
}
