#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int dx8[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy8[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
template <class T = long long>
T in() {
  T _in;
  cin >> _in;
  return _in;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || B > D) {
      cout << "No" << endl;
      continue;
    }
    if (B <= C) {
      cout << "Yes" << endl;
      continue;
    }
    set<long long> s;
    D = D % B;
    while (true) {
      if (s.find(A) != s.end()) {
        cout << "Yes" << endl;
        break;
      }
      s.insert(A);
      if (A < B || A % B > C) {
        cout << "No" << endl;
        break;
      }
      A %= B;
      A += D;
    }
  }
  return 0;
}
