#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, i, cnt = 0;
  long a[310], b[310], c[310], d[310];
  bool flag;
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (i = 0; i < N; i++) {
    flag = true;
    while (cnt < 10000) {
      a[i] -= b[i];
      if (a[i] < 0) {
        flag = false;
        break;
      }
      if (a[i] <= c[i]) {
        a[i] += d[i];
      }
      cnt++;
    }
    cnt = 0;
    if (flag) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
}
