#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  long long A, B, C, D;
  cin >> T;
  for (int x = 0; x < (T); x++) {
    cin >> A >> B >> C >> D;
    long long miss = B - D;
    long long check = 0;
    if ((C + D) % B > C) {
      cout << "No" << endl;
      ;
    } else {
      while (check <= C + 1) {
        if (A / B == 0) {
          break;
        }
        A %= B;
        if (A <= C) {
          A += D;
          check++;
        }
        if (A < miss || (A < B && C < A)) {
          break;
        }
      }
      if (check != C + 2) {
        cout << "No" << endl;
        ;
      } else {
        cout << "Yes" << endl;
        ;
      }
    }
  }
}
