#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int test, t, a, b, c, d, i, j, k, cur;
  scanf("%lld", &test);
  for (t = 1; t <= test; t++) {
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    if (a < b || d < b) {
      printf("No\n");
      continue;
    }
    if (c >= b) {
      printf("Yes\n");
      continue;
    }
    j = 1;
    cur = a;
    for (i = 1; i <= 1e5; i++) {
      if (cur < b) {
        j = 0;
        break;
      }
      cur %= b;
      if (cur <= c) cur += d;
    }
    if (j) {
      printf("Yes\n");
    } else
      printf("No\n");
  }
}
