#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d;
long long gcd(long long a, long long b) {
  if (b == 0LL) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
void solve() {
  scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
  if (b > d) {
    printf("No\n");
    return;
  }
  if (c >= b - 1) {
    printf("Yes\n");
    return;
  }
  a -= (a / b) * b;
  long long g = gcd(d, b);
  long long x = (b - 1 - a) / g;
  if (a + g * x >= c + 1) {
    printf("No\n");
  } else {
    printf("Yes\n");
  }
}
int main() {
  scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}
