#include <bits/stdc++.h>
using namespace std;
long long gcd(long long m, long long n) {
  if ((0 == m) || (0 == n)) return 0;
  while (m != n) {
    if (m > n)
      m = m - n;
    else
      n = n - m;
  }
  return m;
}
bool calc(long long a, long long b, long long c, long long d) {
  if (d < b) return false;
  if (a < b) return false;
  a -= b * (a / b);
  d -= b * (d / b);
  if (a > c) return false;
  if (d && gcd(b, d) + c < b) return false;
  return true;
}
int main() {
  int t;
  cin >> t;
  for (decltype(t) i = (0); i < (t); ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << (calc(a, b, c, d) ? "Yes" : "No") << endl;
  }
  return 0;
}
