#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e6 + 10;
const int inf = (int)2e9;
long long A, B, C, D;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
    int f = 1;
    long long tot = A;
    for (int i = 1; i <= 100000; i++) {
      if (tot < B) {
        f = 0;
        break;
      }
      tot -= B;
      if (tot <= C) tot += D;
    }
    if (f == 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
