#include <bits/stdc++.h>
using namespace std;
bool can_continue(long long A, long long B, long long C, long long D);
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (can_continue(A, B, C, D)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
bool can_continue(long long A, long long B, long long C, long long D) {
  long long count = A;
  for (int i = 0; i < 100000000; i++) {
    if (i > 0 && count == A) {
      return true;
    }
    if (count < B) {
      return false;
    }
    count -= B;
    if (count <= C) {
      count += D;
    }
  }
  return true;
}
