//#include "b_impl.hpp"

//int main() {
//  freopen("/Users/simon/tmp/test.txt", "r", stdin);
//  // freopen("/Users/simon/tmp/test_output.txt", "w", stdout);
//  int num_cases;
//  cin >> num_cases;
//  for (int i = 0; i < num_cases; ++i) {
//    cout << "Case #" << i + 1 << ": ";
//    solve();
//  }
//}

#include <bits/stdc++.h>
using namespace std;

long long gcd(long long a, long long b) {
   if(b == 0) return a;
   return gcd(b, a % b);
}

void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;

  if (d < b || a < b) {
    cout << "No" << endl;
    return;
  }

  if (b <= c + 1) {
    cout << "Yes" << endl;
    return;
  }

  long long g = gcd(b, d);

  long long k = ceil(((double) b - (double) a % b) / g)  - 1;
  long long mx = a % b + k * g;
  if (mx <= c) {
    cout << "Yes" << endl;
    return;
  }

  cout << "No" << endl;
}

int main() {
//  freopen("/Users/simon/tmp/test.txt", "r", stdin);

  int num_cases;
  cin >> num_cases;
  for (int i = 0; i < num_cases; ++i) {
    solve();
  }
}
