#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using P = pair<long long, long long>;
const long long INF = (long long)1e9;
const LL INFL = (LL)1e18;
const long long MOD = 1e9 + 7;
long long dy[] = {0, 0, 1, -1, 0};
long long dx[] = {1, -1, 0, 0, 0};
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long t;
  cin >> t;
  for (long long i = (long long)(0); i < (long long)(t); ++i) {
    LL a, b, c, d;
    cin >> a >> b >> c >> d;
    LL num = a - d;
    bool flag = false;
    LL cur = a;
    map<LL, bool> mp;
    mp[a] = true;
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    while (1) {
      if (cur < b) break;
      LL ok = INFL, ng = -1;
      while (abs(ok - ng) > 1) {
        LL mid = (ok + ng) / 2;
        if (cur - mid * b <= c)
          ok = mid;
        else
          ng = mid;
      }
      if (cur < ok * b) break;
      cur -= ok * b;
      cur += d;
      if (mp[cur]) {
        flag = true;
        break;
      }
      mp[cur] = true;
    }
    cout << (flag ? "Yes" : "No") << endl;
  }
}
