#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d;
int ans[310];
int main() {
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      continue;
    }
    set<long long> s;
    bool r = true;
    do {
      s.insert((a % b));
      if ((a % b) <= c && b <= ((a % b) + d)) {
        a = (a % b) + d;
      } else {
        r = false;
        break;
      }
    } while (s.count((a % b)) == 0);
    if (!r) continue;
    ans[i] = 1;
  }
  for (int i = 0; i < t; i++) {
    if (ans[i] == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
