#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  for (int i = 1; i <= t; ++i) {
    cin >> a >> b >> c >> d;
    long long cur = a, j = 0;
    bool first = 0;
    while (j < 100000) {
      if (cur < b) {
        cout << "No\n";
        first = 1;
        break;
      }
      cur = cur % b;
      if (cur <= c) {
        cur += d;
      }
      ++j;
    }
    if (!first) cout << "Yes\n";
  }
  return 0;
}
