#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int INF = (long long int)1e15;
string ans[305];
long long int LCM(long long int a, long long int b) {
  if (a < b) std::swap(a, b);
  long long int c = a % b;
  if (c == 0) return b;
  return LCM(b, c);
}
string check(long long int a, long long int b, long long int c,
             long long int d) {
  if (d < b) return "No";
  if (b < c) return "Yes";
  long long int x = (a - c) / b;
  x = std::max(x, (long long int)1);
  long long int l = a - x * b;
  long long int r = d % b;
  if (l < 0) return "No";
  if (l > c) {
    l -= b;
    if (l < 0) {
      return "No";
    }
  }
  if (r == 0) return "Yes";
  long long int k = LCM(c, r);
  if (k < (b - c)) return "No";
  return "Yes";
}
int main() {
  int T;
  cin >> T;
  for (long long int i = (long long int)(0); i < (long long int)(T); ++i) {
    long long int A, B, C, D;
    cin >> A >> B >> C >> D;
    ans[i] = check(A, B, C, D);
  }
  for (long long int i = (long long int)(0); i < (long long int)(T); ++i) {
    cout << ans[i] << endl;
  }
  return 0;
}
