#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e15;
const long long int MOD = 1e9 + 7;
signed main() {
  long long int n;
  cin >> n;
  for (long long int i = 0; i < (n); ++i) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (b <= c) {
      cout << "Yes" << endl;
      continue;
    }
    long long int aa = a % b;
    if (c < aa && aa < b) {
      cout << "No" << endl;
      continue;
    }
    if (b == d) {
      cout << "Yes" << endl;
      continue;
    }
    long long int s = (c - aa) / (d - b);
    s = (s + 1) * (d - b) + aa;
    if (c < s && s < b) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
  return 0;
}
