#include <bits/stdc++.h>
using namespace std;
int main() {
  long long T;
  cin >> T;
  long long sta = 0;
  for (int i = 0; i < T; ++i) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A - B < 0) {
      cout << "No" << endl;
      continue;
    }
    if (C < A - B && A - B < B) {
      cout << "No" << endl;
      continue;
    }
    if (B == D) {
      cout << "Yes" << endl;
      continue;
    }
    long long syokou = A % B;
    long long sa = D - B;
    long long ma = C / sa + 1;
    long long ma_ = syokou + (ma)*sa;
    if (C < ma_ && ma_ < B) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
