#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long rem = a;
    while (true) {
      if (rem / b == 0) {
        cout << "No" << endl;
        break;
      }
      rem %= b;
      if (rem <= c) rem += d;
      if (rem == a) {
        cout << "Yes" << endl;
        break;
      }
    }
  }
  return 0;
}
