#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  while (n--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool f = true;
    for (int i = 1; i <= 100000; ++i) {
      a = a % b;
      if (a <= c) a += d;
      if (a < b) {
        f = false;
        break;
      }
    }
    if (f)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
