#include <bits/stdc++.h>
using namespace std;
using LL = long long;
LL a, b, c, d;
unordered_set<LL> vis;
int main() {
  int T;
  cin >> T;
  while (T--) {
    cin >> a >> b >> c >> d;
    vis.clear();
    vis.insert(a);
    bool flag = 1;
    while (1) {
      LL t = max(1LL, (a - c + b - 1) / b);
      a -= b * t;
      if (a < 0) {
        flag = 0;
        break;
      }
      if (a <= c) a += d;
      if (vis.count(a)) break;
    }
    puts(flag ? "Yes" : "No");
  }
  return 0;
}
