#include <bits/stdc++.h>
using namespace std;
long long f(long long A, long long B, long long C) {
  A %= B;
  if (C > A) A += (C - A) - (C - A) % B;
  return A;
}
int main() {
  long long A, B, C, D;
  int t;
  cin >> t;
  while (t--) {
    cin >> A >> B >> C >> D;
    set<long long> s;
    bool ok;
    while (1) {
      if (A < B) {
        ok = 0;
        break;
      } else
        A = f(A, B, C);
      if (A <= C) A += D;
      if (s.count(A)) {
        ok = 1;
        break;
      } else
        s.insert(A);
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
