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