#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int w = 1, s = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return w * s;
}
map<long long, long long> mp;
long long T, a, b, c, d;
inline bool work(long long x, long long y, long long z, long long w) {
  mp.clear();
  while (1) {
    long long tmp = (x - z) / y;
    tmp = max(1ll * 0, tmp);
    x -= tmp * y;
    if (tmp == 0 || (x > z)) x -= y;
    if (x < 0) return 0;
    if (mp.count(x)) return 1;
    mp[x] = 1;
    x += w;
  }
}
int main() {
  T = read();
  while (T--) {
    cin >> a >> b >> c >> d;
    if (work(a, b, c, d))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
