#include <bits/stdc++.h>
using namespace std;
template <class T>
const bool is_impar(const T &x) {
  return (bool)(x & 1);
}
int T;
long long a, b, c, d;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> T;
  for (int(i5) = (0); (i5) < (int)(T); (i5) += (1)) {
    cin >> a >> b >> c >> d;
    int result = 0;
    if (d < b) {
      cout << "No\n";
      continue;
    } else
      while (result < 10000) {
        if (b > a) break;
        long long aprim = a % b;
        if (aprim > c) break;
        aprim = aprim + b * (((c - aprim) / b) + 1);
        if (aprim < b) break;
        while (aprim > c) aprim -= b;
        if (aprim < 0) break;
        a = aprim;
        a += d;
        result++;
      }
    if (result == 10000)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
