#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1000000010;
const long long LINF = 4000000000000000010;
int dx[5] = {0, 1, 0, -1, 0};
int dy[5] = {1, 0, -1, 0, 0};
int main() {
  int q;
  cin >> q;
  while (q--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    int cc = 100000;
    long long n = a;
    bool ans = true;
    while (cc--) {
      if (n > c) {
        n -= b * ((n - c) / b);
        if (n > c) {
          n -= b;
        }
        if (n < 0) {
          ans = false;
          break;
        }
        n += d;
      } else {
        n -= b;
        if (n < 0) {
          ans = false;
          break;
        }
        n += d;
      }
    }
    if (ans) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
