#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
const int MAGIC = 7474;
string solve(long long a, long long b, long long c, long long d) {
  if (a < b || d < b) return "No";
  if (c >= b) return "Yes";
  for (int i = (0); i < (MAGIC); ++i) {
    a %= b;
    if (a > c) return "No";
    a += d;
  }
  return "Yes";
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << solve(a, b, c, d) << endl;
  }
  return 0;
}
