#include <bits/stdc++.h>
using namespace std;
const int N = 1000000;
const int mod = 998244353;
const long long INF = 1LL << 60;
long long t, a, b, c, d;
int main() {
  cin >> t;
  for (long long i = (long long)0; i < (long long)t; ++i) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (d % b == 0) {
      cout << (a % b <= c ? "Yes" : "No") << endl;
      continue;
    }
    long long n = d % b;
    if (b % n != 0) {
      cout << (c >= b - 1 ? "Yes" : "No") << endl;
      continue;
    }
    bool ans = 1;
    long long p = (a / b + 1) * b;
    p -= a;
    p = p / n - (p % n == 0 ? 1 : 0);
    cout << ((a + p * n) % b <= c ? "Yes" : "No") << endl;
  }
  return 0;
}
