#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
constexpr double EPS = 1e-9;
constexpr double PI = 3.141592653589793238462643383279;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL << 60;
constexpr long long MOD = 1000000007;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main(void) {
  int T;
  cin >> T;
  for (int _ = (0); _ < (T); ++_) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    for (int i = (0); i < (100000); ++i) {
      if (A - C <= 0)
        A -= B;
      else
        A -= (A - C + B - 1) / B * B;
      if (A < 0) break;
      A += D;
    }
    cout << (A >= 0 ? "Yes" : "No") << "\n";
  }
  return 0;
}
