#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long a, b, c, d;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    bool check = 1;
    if (d < b) check = 0;
    long long k = a % b;
    if (k > c) check = 0;
    d %= b;
    if (c + 1 < b && d > 0) {
      for (long long i = 1; i <= 1e5 && check; i++) {
        long long t = (c + 1 - k + d - 1) / d;
        k += t * d;
        k %= b;
        if (k > c) {
          check = 0;
          break;
        }
      }
    }
    if (check)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
  return 0;
}
