#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& a) {
  return os << "(" << a.first << "," << a.second << ")";
}
template <class T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cout << (*i) << " ";
  cout << endl;
}
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
int nextInt() {
  int x;
  scanf("%d", &x);
  return x;
}
long long nextLong() {
  long long x;
  scanf("%lld", &x);
  return x;
}
bool solve(long long A, long long B, long long C, long long D) {
  if (B > A) return false;
  if (B > D) return false;
  if (C >= B - 1) return true;
  long long a = A % B;
  long long d = D % B;
  if (d == 0) {
    if (C < a) return false;
    return true;
  } else {
    long long x = a + (C - a + d) / d * d;
    x %= B;
    if (C < x) return false;
    return true;
  }
  return false;
}
int main2() {
  int T = nextInt();
  for (; T--;) {
    long long A = nextLong();
    long long B = nextLong();
    long long C = nextLong();
    long long D = nextLong();
    bool res = solve(A, B, C, D);
    cout << (res ? "Yes" : "No") << endl;
  }
  return 0;
}
int main() {
  for (; !cin.eof(); cin >> ws) main2();
  return 0;
}
