#include <bits/stdc++.h>
using namespace std;
long long T;
long long a, b, c, d;
map<long long, bool> used;
int main() {
  cin >> T;
  while (T--) {
    cin >> a >> b >> c >> d;
    if (d < b) {
      cout << "No" << endl;
      continue;
    }
    a -= b;
    if (a > c) {
      long long y = (a - c + b - 1) / b;
      a -= y * b;
    }
    if (a < 0) {
      cout << "No" << endl;
      continue;
    }
    if (b == d) {
      cout << "Yes" << endl;
      continue;
    }
    long long y = (c - a) / (d - b);
    y++;
    if (a + y * (d - b) < b) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
