#include <bits/stdc++.h>
using namespace std;
int N;
long long A, B, C, D;
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A >> B >> C >> D;
    if (A < B || B > D) {
      cout << "No" << endl;
    } else if (B <= C) {
      cout << "Yes" << endl;
    }
    bool flag = true;
    long long AmodB = A % B, DmodB = D % B;
    for (int k = 0; k < B; k++) {
      if ((AmodB + k * DmodB) % B > C) {
        cout << "No" << endl;
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "Yes" << endl;
    }
  }
}
