#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  long long a[T], b[T], c[T], d[T];
  for (int i = 0; i < T; i++) cin >> a[i] >> b[i] >> c[i] >> d[i];
  long long mod[T], stock[T];
  string ans[T];
  int flag;
  for (int i = 0; i < T; i++) {
    stock[i] = a[i];
    flag = 1;
    for (int j = 0; j < b[i] + 10; j++) {
      if (stock[i] < b[i] || b[i] > d[i]) {
        ans[i] = "No";
        flag = 0;
        break;
      }
      stock[i] = stock[i] % b[i];
      while (stock[i] + b[i] <= c[i]) stock[i] += b[i];
      if (stock[i] <= c[i]) stock[i] += d[i];
    }
    if (flag) ans[i] = "Yes";
  }
  for (int i = 0; i < T; i++) cout << ans[i] << endl;
}
