#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;
    }
    if (a % b > c) {
      ans.push_back("No");
      continue;
    }
    if (d % b == 0) {
      ans.push_back("Yes");
      continue;
    }
    long long int current = a % b;
    while (true) {
      current += ((c - current) / (d % b) + 1) * (d % b) - b;
      if (current < 0) {
        ans.push_back("No");
        break;
      }
      if (current == a % b + ((c - a % b) / (d % b) + 1) * (d % b) - b) {
        ans.push_back("Yes");
        break;
      }
    }
  }
  for (string f : ans) {
    cout << f;
    cout << "\r\n";
  }
  return 0;
}
