#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long LINF = 1e18;
bool check(long long a, long long b, long long c, long long d, int t) {
  if (t == 10000) return true;
  if (t % 2) {
    long long m = 0;
    if ((c - a) % (d - b) == 0)
      m = (c - a) / (d - b) + 1;
    else
      m = (c - a) / (d - b) + 1;
    if (check(a + m * (d - b), b, c, d, t + 1))
      return true;
    else
      return false;
  } else {
    long long m = 0;
    if ((a - c) % b == 0)
      m = (a - c) / b;
    else
      m = (a - c) / b + 1;
    if (0 > a - m * b || m == 0) return false;
    if (check(a - m * b, b, c, d, t + 1)) return true;
  }
  return false;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long m = 0;
    if ((a - c) % b == 0)
      m = (a - c) / b;
    else
      m = (a - c) / b + 1;
    if (a - m * b < 0)
      puts("No");
    else if (b > d)
      puts("No");
    else if (b == d)
      puts("Yes");
    else {
      if (check(a, b, c, d, 0))
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}
