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