#include <bits/stdc++.h>
using namespace std;
int main() {
  int testCnt;
  cin >> testCnt;
  while (testCnt--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b)
      cout << "No" << endl;
    else if (d < b)
      cout << "No" << endl;
    else {
      if (c >= b - 1) {
        cout << "Yes" << endl;
        continue;
      }
      d = d % b;
      a = a % b;
      if (a > c) {
        cout << "No" << endl;
        continue;
      }
      long long f = (c + 1) - a;
      long long s = (b - 1) - a;
      if (d == 0) {
        cout << "Yes" << endl;
        continue;
      }
      if (b - 1 - (c + 1) + 1 >= d) {
        cout << "No" << endl;
        continue;
      }
      if (f % d > s % d || f % d == 0)
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
      continue;
    }
  }
  return 0;
}
