#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int main() {
  ll T;
  cin >> T;
  ll a[T], b[T], c[T], d[T];
  for (int i = 0; i < T; i++) cin >> a[i] >> b[i] >> c[i] >> d[i];
  ll num = 0;
  ll tmp = 0;
  for (int i = 0; i < T; i++) {
    num = a[i];
    while (num > c[i] + b[i]) {
      num -= b[i];
    }
    tmp = num;
    num -= b[i];
    num += d[i];
    if (num >= tmp) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
