#include <bits/stdc++.h>
using namespace std;
set<__int128> st;
bool solve(__int128 a, __int128 b, __int128 c, __int128 d, int cnt) {
  if (a < b) return 0;
  if (d >= b && c >= b) return 1;
  if (st.find(a) != st.end()) return 1;
  st.insert(a);
  if (cnt == 100000) return 0;
  a -= b;
  if (a <= c) a += d;
  return solve(a, b, c, d, cnt + 1);
}
int main() {
  int t;
  cin >> t;
  unsigned long long a, b, c, d;
  while (t--) {
    cin >> a >> b >> c >> d;
    st.clear();
    int ret = solve(a, b, c, d, 0);
    if (ret)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
  return 0;
}
