#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  scanf("%d", &T);
  for (int i_test = (1); i_test <= (T); ++i_test) {
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (d < b || a < b) {
      puts("No");
      continue;
    }
    if (c > b) {
      puts("Yes");
      continue;
    }
    bool valid = 1;
    long long tmp = a;
    for (int k = (1); k <= (10000); ++k) {
      if (a < b) {
        puts("No");
        valid = 0;
        break;
      }
      a %= b;
      if (a <= c) {
        if (d % b == 0) break;
        a += d;
      }
    }
    a = tmp;
    if (!valid) continue;
    for (int k = (1); k <= (10000); ++k) {
      a %= b;
      if (a <= c) {
        if (d % b == 0) break;
        a += ((c - a) / (d % b) + 1) * (d % b);
      } else {
        puts("No");
        break;
      }
    }
    if (valid) puts("Yes");
  }
  return 0;
}
