#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30);
const long long inf = (1LL << 60LL);
const int maxn = 1e5 + 10;
long long A, B, C, D;
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    cin >> A >> B >> C >> D;
    long long a = A, b = B, c = C, d = D;
    string ret = "Yes";
    for (int i = 0; i < 200000; i++) {
      if (a >= b) {
        a %= b;
      } else {
        ret = "No";
        break;
      }
      if (a <= c) {
        a += d;
      }
    }
    cout << ret << endl;
  }
  return 0;
}
