#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e18 + 9;
long long T;
long long A, B, C, D;
bool ok(long long mid) { return C < (A + mid) % B; }
int main() {
  cin >> T;
  for (long long i = (0); i < (T); i++) {
    cin >> A >> B >> C >> D;
    long long lb = 0;
    for (long long i = 0; i < 20000; i += D) {
      lb |= ok(i);
      if (lb) break;
    }
    if (A < B || B > D || lb == 1) {
      cout << ("No") << endl;
    } else {
      cout << ("Yes") << endl;
    }
  }
  return 0;
}
