#include <bits/stdc++.h>
using namespace std;
int isPossible(long long int a, long long int b, long long int c,
               long long int d) {
  if (a < b) return 0;
  if (b == d) {
    if (a - b <= c)
      return 1;
    else
      return 0;
  } else if (b < d) {
    a %= b;
    long long int j = (2 * b + a - 1) / (d - b);
    if ((a - b) + j * (d - b) <= c)
      return 1;
    else
      return 0;
  } else
    return 0;
}
int main() {
  int n;
  long long int a, b, c, d;
  cin >> n;
  string Ans[n];
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    if (isPossible(a, b, c, d))
      Ans[i] = "Yes";
    else
      Ans[i] = "No";
  }
  for (int i = 0; i < n; i++) {
    cout << Ans[i] << endl;
  }
  return 0;
}
