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