#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 10;
const int mod = (int)998244353;
long long a, b, c, d;
int solve() {
  if (b > d || b > a) return 0;
  if (c >= b) return 1;
  a %= b;
  if (c < a) return 0;
  map<long long, long long> w;
  while (1) {
    if (w[a]) return 1;
    w[a] = 1;
    a += d;
    a %= b;
    if (c < a) return 0;
  }
  return -1;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    int ans = solve();
    if (ans == 0)
      cout << "No";
    else if (ans == 1)
      cout << "Yes";
    else
      cout << "?";
    cout << "\n";
  }
  return 0;
}
