#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
constexpr int dx[4] = {1, 0, -1, 0};
constexpr int dy[4] = {0, 1, 0, -1};
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
void solve(long long A, long long B, long long C, long long D) {
  if (B > D) {
    cout << "No" << endl;
    return;
  }
  if (A < B) {
    cout << "No" << endl;
    return;
  }
  long long g = gcd(B, D);
  A = A % B;
  C = C % B;
  D = D % B;
  if (C < A) {
    cout << "No" << endl;
    return;
  }
  long long k = ((C - A) + B) % B / g;
  if ((A % B + (k + 1) * g) % B > C % B) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    solve(A, B, C, D);
  }
  return 0;
}
