#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N = 0, D = 0, A = 0, B = 0, C = 0;
  long long a[300] = {0};
  long long b[300] = {0};
  long long c[300] = {0};
  long long d[300] = {0};
  string s;
  long long min = 0, min2 = 0;
  long long dif = 0;
  long long hoge = 0;
  long long sum = 0;
  cin >> N;
  for (long long i = 0; i < N; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (long long i = 0; i < N; i++) {
    sum = a[i];
    if (a[i] < b[i] || d[i] < b[i]) {
      min = 1;
    } else {
      while (true) {
        if (a[i] > c[i]) {
          a[i] -= b[i];
        } else {
          a[i] += (d[i] - b[i]);
        }
        if (a[i] < 0) {
          min = 1;
          hoge = 0;
          break;
        }
        if (hoge == 100000000) {
          min = 0;
          hoge = 0;
          break;
        }
        hoge++;
      }
    }
    if (min == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    min = 0;
  }
  return 0;
}
