#include <bits/stdc++.h>
using namespace std;
const int M = 1e6 + 7;
int a[M];
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool ok = true;
    long long tm = a / b;
    a = a - (b * tm);
    int tst = 100000000;
    while (tst--) {
      if (a <= c) a = a + d;
      if ((a > c) && (a < b)) {
        ok = false;
        break;
      }
      a = a - b;
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
