#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    unordered_set<long long> s;
    while (true) {
      long long k = (a - c) / b;
      k = max(1LL, k);
      long long x = a - b * k;
      if (x > c) x -= b;
      if (x < 0) {
        puts("No");
        goto end;
      }
      if (s.count(x)) break;
      s.insert(x);
      a = x + d;
    }
    puts("Yes");
  end:;
  }
}
