#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long aa[t], bb[t], cc[t], dd[t];
  for (int i = 0; i < t; i++) {
    cin >> aa[i] >> bb[i] >> cc[i] >> dd[i];
  }
  for (int i = 0; i < t; i++) {
    long long a = aa[i], b = bb[i], c = cc[i], d = dd[i];
    if (b > d || a < b) {
      cout << "No" << endl;
      continue;
    }
    long long e = a % b + b * ((c - a % b) / b);
    set<long long> st;
    st.insert(e);
    while (true) {
      if (e <= c) {
        e += d;
        e = e % b + b * ((c - a % b) / b) + b;
      }
      e -= b;
      if (e < 0) {
        cout << "No" << endl;
        break;
      }
      if (st.find(e) != st.end()) {
        cout << "Yes" << endl;
        break;
      } else {
        st.insert(e);
      }
    }
  }
  return 0;
}
