#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  int r = x % y;
  int a;
  int b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int main() {
  int t;
  long long a, b, c, d;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    long long z = gcd(b, d);
    if (a >= b && b <= d && a % z <= c && z >= b - c)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
