#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long mod = 1e9 + 7;
const long long mod1 = 998244353;
const long long big = 1e18;
const double PI = 2 * asin(1);
long long gcd(long long a, long long b) {
  long long v0 = a, v1 = b, v2 = v0 % v1;
  while (v2 > 0) {
    v0 = v1;
    v1 = v2;
    v2 = v0 % v1;
  }
  return v1;
}
int main() {
  int T;
  cin >> T;
  long long A, B, C, D;
  long long tmp1, tmp2;
  string ans[T];
  for (int i = 0; i < T; ++i) {
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      ans[i] = "No";
      continue;
    }
    if (C >= B) {
      ans[i] = "Yes";
      continue;
    }
    A %= B;
    tmp1 = D % B;
    if (tmp1 == 0) {
      if (A > C)
        ans[i] = "No";
      else
        ans[i] = "Yes";
      continue;
    }
    if (gcd(B, tmp1) == 1) {
      if (B - 1 > C)
        ans[i] = "No";
      else
        ans[i] = "Yes";
      continue;
    }
    if ((B - A) % tmp1 == 0)
      tmp2 = (B - A) / tmp1 - 1;
    else
      tmp2 = (B - A) / tmp1;
    if (A + tmp1 * tmp2 > C)
      ans[i] = "No";
    else
      ans[i] = "Yes";
  }
  for (int i = 0; i < T; ++i) cout << ans[i] << endl;
}
