#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (long long(i) = (0); (i) < (n); ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    a -= b;
    if (a < 0 || d < b) {
      ;
      cout << "No" << endl;
      continue;
    }
    if (b <= c) {
      ;
      cout << "Yes" << endl;
      continue;
    }
    long long tmp1 = ((a - c) / b);
    a -= tmp1 * b;
    if (a > c) a -= b;
    if (a < 0) {
      ;
      cout << "No" << endl;
      continue;
    }
    if (d % b == 0) {
      ;
      cout << "Yes" << endl;
      continue;
    }
    long long seica = (c - a) / (d % b) + 1;
    if (a + seica * (d % b) >= b) {
      ;
      ;
      cout << "Yes" << endl;
      continue;
    };
    cout << "No" << endl;
  }
  return 0;
}
