#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
      continue;
    }
    bool f = true;
    for (int j = 0; j < 100; j++) {
      a -= a / b * b;
      if (a <= c) a += d;
      if (a < b) {
        f = false;
        cout << "No" << endl;
        break;
      }
    }
    if (f) cout << "Yes" << endl;
  }
}
