#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool pos = true;
    int cnt = 50000;
    if (a < b) {
      cout << "No"
           << "\n";
      continue;
    }
    long long k = (a - c) / b;
    a -= b * max(k, 1LL);
    if (a > c) a -= b;
    if (a <= c) a += d;
    while (cnt--) {
      if (a < b) {
        cout << "No"
             << "\n";
        pos = false;
        break;
      }
      long long s = (a - c) / b;
      a -= b * max(s, 1LL);
      if (a > c) a -= b;
      if (a < 0) {
        cout << "No"
             << "\n";
        pos = false;
        break;
      }
      if (a <= c) a += d;
    }
    if (pos)
      cout << "Yes"
           << "\n";
  }
}
