#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 || d < b) ans = 0;
    if (d > b) {
      if (c >= b - 1 || d % b == 0) continue;
      __int128 diff = d - b;
      __int128 low = (c + b - a) / diff + 1;
      if (a + diff * low - b < b)
        ans = 0;
      else {
        __int128 aold = a + diff * low;
        a = a + diff * low - 2 * b + d;
        __int128 low = (c + b - a) / diff + 1;
        if (a + diff * low != aold) {
          ans = 0;
        }
      }
    }
  }
}
