#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long T;
  cin >> T;
  while (T--) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << ("No") << endl;
      ;
    } else if (B > D) {
      cout << ("No") << endl;
      ;
    } else if (C >= B - 1) {
      cout << ("Yes") << endl;
      ;
    } else {
      long long L = ((C - A + 1) % B + B) % B;
      long long R = ((B - A - 1) % B + B) % B;
      if (L <= R) {
        long long v = gcd(B, D);
        if (R / v == L / v && L % v != 0) {
          cout << ("Yes") << endl;
          ;
        } else {
          cout << ("No") << endl;
          ;
        }
      } else {
        cout << ("Yes") << endl;
        ;
      }
    }
  }
}
