#include <bits/stdc++.h>
using namespace std;
long long modpow(long long x, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * x % 1000000007LL;
    x = x * x % 1000000007LL;
    n >>= 1;
  }
  return res;
}
int main() {
  long long i, t, str = 0;
  cin >> t;
  bool ans = false;
  long long a[t], b[t], c[t], d[t];
  for (i = 0; i < t; i++) cin >> a[i] >> b[i] >> c[i] >> d[i];
  for (i = 0; i < t; i++) {
    map<long long, long long> daymp, ngtmp;
    str = a[i];
    ngtmp[str]++;
    ans = false;
    while (1) {
      str -= b[i];
      if (str < 0) {
        ans = false;
        break;
      }
      if (daymp[str] == 1) {
        ans = true;
        break;
      }
      daymp[str]++;
      if (0 <= str && str <= c[i]) {
        str += d[i];
        if (ngtmp[str] == 1) {
          ans = true;
          break;
        }
        ngtmp[str]++;
      } else {
        if (ngtmp[str] == 1) {
          ans = true;
          break;
        }
        ngtmp[str]++;
      }
    }
    if (ans)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
