#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a < b) {
    return gcd(b, a);
  }
  return b == 0 ? a : gcd(b, a % b);
}
bool solve(long long a, long long b, long long c, long long d) {
  if (a < b || d < b) {
    return false;
  }
  if (c >= b) {
    return true;
  }
  auto dv = gcd(d, b);
  long long mx = 0;
  for (int i = 0; i < b; i++) {
    mx = max(mx, (a + i * d) % b);
  }
  return mx <= c;
}
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << (solve(a, b, c, d) ? "Yes" : "No") << endl;
  }
}
