#include <bits/stdc++.h>
using namespace std;
const int MX = 100010, inf = 2e9;
int t;
long long a, b, c, d;
bool solve() {
  if (a < b) return false;
  if (d < b) return false;
  if (c >= b) return true;
  d %= b;
  if (d == 0) {
    return a % b <= c;
  } else {
    long long chk = a % b + ((b - 1 - (a % b)) / d) * d;
    return chk <= c;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  for (int i = 1; i <= t; i++) {
    cin >> a >> b >> c >> d;
    cout << (solve() ? "Yes" : "No") << '\n';
  }
  return 0;
}
