#include <bits/stdc++.h>
using namespace std;
template <class U, class T>
void Max(U &first, T second) {
  if (first < second) first = second;
}
template <class U, class T>
void Min(U &first, T second) {
  if (first > second) first = second;
}
template <class T>
void add(int &a, T b) {
  a = (a + b) % 998244353;
}
int pow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1LL * ans * a % 998244353;
    a = 1LL * a * a % 998244353;
    b >>= 1;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  srand(time(NULL));
  int T, ca = 0, m = 0, k, i, j, n, K;
  scanf("%d", &T);
  long long a, b, c, d;
  while (T--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (d < b || a < b) {
      puts("No");
      continue;
    }
    a -= b;
    long long first = max(0LL, (a - c) / b);
    a -= b * first;
    d %= b;
    if (d == 0) {
      if (a > c) {
        if (a < b) {
          puts("No");
          continue;
        }
        a -= b;
      }
      puts("Yes");
      continue;
    }
    if (c >= b - 1) {
      puts("Yes");
      continue;
    }
    long long g = gcd(b, d);
    long long l = c - a, r = b - a;
    r = (r - 1) / g;
    l = l / g + 1;
    if (l > r)
      puts("Yes");
    else
      puts("No");
  }
}
