#include <bits/stdc++.h>
using namespace std;
map<int, bool> bio;
void solve() {
  bio.clear();
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (d < b) {
    cout << "No\n";
    return;
  }
  if (b > a) {
    cout << "No\n";
    return;
  }
  if (c >= b && d >= b) {
    cout << "Yes\n";
    return;
  }
  long long a1 = a;
  while (1) {
    long long x = a1 - c;
    long long treba = x / b;
    if (x % b) treba++;
    if (a1 - treba * b < 0) {
      cout << "No\n";
      return;
    }
    long long rez = a1 - (treba * b) + d;
    if (bio[rez]) {
      cout << "Yes\n";
      return;
    }
    a1 = rez;
    bio[a1] = 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cout.precision(10);
  cout << fixed;
  int q;
  cin >> q;
  while (q--) {
    solve();
  }
  return 0;
}
