#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, d;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    int ans = a - b;
    while (1) {
      if (ans < 0) {
        cout << "No" << endl;
        break;
      }
      if (ans <= c) ans += d;
      if (ans == a) {
        cout << "Yes" << endl;
        break;
      }
      ans -= b;
    }
  }
}
