#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, m;
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int main() {
  int i, j, k, ans = 0;
  long long x, y, z, w;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x >> y >> z >> w;
    if (z + 1 > y) cout << "Yes" << endl;
    if (w < y || x < y) cout << "No" << endl;
    long long g = gcd(y, w);
    if ((x - z - 1) / g - (x - y) / g > 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
