#include <bits/stdc++.h>
using namespace std;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
int main() {
  long long int n;
  cin >> n;
  vector<string> ans;
  for (int i = (0); i < (n); ++i) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      ans.push_back("No");
      continue;
    }
    if (c >= b) {
      ans.push_back("Yes");
      continue;
    }
    vector<long long int> e;
    while (true) {
      e.push_back(a);
      a -= ((a - c) / b + ((a - c) % b == 0 ? 0 : 1)) * b;
      if (a < 0) {
        ans.push_back("No");
        break;
      }
      if (a <= c) {
        a += d;
      }
      if (find((e).begin(), (e).end(), a) != e.end()) {
        ans.push_back("Yes");
        break;
      }
    }
  }
  for (string f : ans) {
    cout << f;
    cout << "\r\n";
  }
  return 0;
}
