#include <bits/stdc++.h>
using namespace std;
int main() {
  int T = 0;
  cin >> T;
  string ans = "";
  long long A = 0;
  long long B = 0;
  long long C = 0;
  long long D = 0;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    long long tmp = A;
    bool first_check = true;
    while (true) {
      if (A < B) {
        ans = "No";
        break;
      }
      if (first_check) {
        A %= B;
        first_check = false;
      } else {
        A -= B;
      }
      if (A <= C) {
        A += D;
        first_check = true;
      }
      if (A == tmp) {
        ans = "Yes";
        break;
      }
    }
    cout << ans << endl;
  }
}
