#include <bits/stdc++.h>
using namespace std;
int T;
long long A, B, C, D;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> T;
  for (int i = 0; i <= T - 1; ++i) {
    cin >> A >> B >> C >> D;
    if (A > C) A -= B * ((A - C - 1) / B);
    if (A < B)
      cout << "No" << '\n';
    else {
      if (D < B)
        cout << "No" << '\n';
      else if (D == B) {
        if (A % B <= C)
          cout << "Yes" << '\n';
        else
          cout << "No" << '\n';
      } else {
        if (C >= B)
          cout << "Yes" << '\n';
        else {
          long long k = (C - (A - B)) / (D - B);
          if (B <= (A - B) + (k + 1) * (D - B))
            cout << "Yes" << '\n';
          else
            cout << "No" << '\n';
        }
      }
    }
  }
}
