#include <bits/stdc++.h>
using namespace std;
map<long long, int> mp;
long long a, b, c, d, t, nr, cnt;
int main() {
  cin >> t;
  for (int i = 1; i <= t; i++) {
    cin >> a >> b >> c >> d;
    if (c + d < b || a < b) {
      cout << "No\n";
      continue;
    }
    if (c + 1 >= b && d >= b) {
      cout << "Yes\n";
      continue;
    }
    bool ok = 1;
    nr = a;
    while (1) {
      if (nr < b) {
        ok = 0;
        break;
      }
      if (mp[nr] == i) break;
      mp[nr] = i;
      nr %= b;
      if (nr <= c) nr += d;
    }
    if (ok)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
