#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  long long a = 0, b = 0, A, B, C, D;
  cin >> T;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    b = 0;
    if (A < B || B > D)
      cout << "No" << endl;
    else if (B <= C)
      cout << "Yes" << endl;
    else {
      a = A;
      for (int i = 0; i < 100; i++) {
        a = a % B;
        if (C < a) {
          b = 1;
          break;
        }
        a += D;
      }
      if (b == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
}
