#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 1e+14;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No\n";
      continue;
    }
    if (B > D) {
      cout << "No\n";
      continue;
    }
    if (C >= B) {
      cout << "Yes\n";
      continue;
    }
    A %= B;
    D %= B;
    for (int j = 0; j < B; j++) {
      if ((A + j * D) % B > C) {
        cout << "No\n";
        continue;
      }
    }
    cout << "Yes\n";
  }
  return 0;
}
