#include<bits/stdc++.h>

using namespace std;

using int64 = long long;

int main() {
  int T;
  cin >> T;
  while(T--) {
    int64 A, B, C, D;
    cin >> A >> B >> C >> D;
    auto x = __gcd(B, D);
    int64 low = A - (A - C - 1) / x * x;
    if(low < B) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }

}