#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  for (cin >> T; T--;) {
    long long a, b, c, d, ans = 1;
    cin >> a >> b >> c >> d;
    int64_t low = 0, high = 1e18, mid;
    while (low < high) {
      mid = low + high + 1 >> 1;
      if (a < b * mid)
        high = mid - 1;
      else if (a - b * mid <= c)
        high = mid - 1;
      else
        low = mid;
    }
    a -= b * low;
    if (a < b) ans = 0;
    int64_t diff = d - b;
    if (diff < 0) ans = 0;
    if (!diff) goto end;
    if (c < b - 1) {
      if (c / diff != (b - 1) / diff) ans = 0;
    }
  end:;
    cout << (ans ? "Yes\n" : "No\n");
  }
}
