#include <bits/stdc++.h>
using namespace std;
bool solve(long long int a, long long int b, long long int c, long long int d) {
  set<long long int> st;
  bool f = false;
  while (b <= a) {
    long long int aa = a - b;
    a %= b;
    long long int minn = min(aa, c);
    a += max(0ll, (minn - a)) / b * b;
    while (a + b <= minn) a += b;
    if (0 < st.count(a)) {
      f = true;
      break;
    }
    st.insert(a);
    if (a <= c) a += d;
  }
  return f;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  for (auto times = 0; times < (t); times++) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    bool f = false;
    if (a < b)
      f = false;
    else if (d < b)
      f = false;
    else if (b <= c && b <= d)
      f = true;
    else
      f = solve(a, b, c, d);
    cout << (f ? "Yes" : "No") << endl;
  }
  return 0;
}
