#include <bits/stdc++.h>
using namespace std;
const long long INF =
    sizeof(long long) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const long long MOD = (long long)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  long long T;
  cin >> T;
  for (long long cnt = (0); cnt < (T); cnt++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    string ans = "Yes";
    if (a < b) {
      ans = "No";
    } else {
      if (b > d) {
        ans = "No";
      } else {
        if (b <= c) {
          ans = "Yes";
        } else {
          set<long long> s;
          for (long long i = (0); i < (1000000ll); i++) {
            if (a < b) {
              ans = "No";
              break;
            }
            if (s.count(a)) {
              break;
            } else {
              s.insert(a);
            }
            a %= b;
            if (a <= c) {
              a += d;
            }
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
