#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d;
long long mygcd(long long x, long long y) { return !y ? x : mygcd(y, x % y); }
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (d < b || a < b) {
      puts("No");
      continue;
    }
    if (c >= b) {
      puts("Yes");
      continue;
    }
    if (d % b == 0) {
      if (a % b <= c)
        puts("Yes");
      else
        puts("No");
      continue;
    }
    long long dif = b / mygcd(b, d % b);
    if (dif > c + 1 || d % b <= b - c - 1)
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
