#include <bits/stdc++.h>
using namespace std;
string zaikoTest(int a, int b, int c, int d) {
  string ans;
  int k;
  k = ((a - c + b - 1) / b);
  if (a - k * b + d - b - c > 0)
    ans = "Yes";
  else
    ans = "No";
  return ans;
}
int main() {
  int T;
  int a[310], b[310], c[310], d[310];
  cin >> T;
  for (int i = 0; i < T; ++i) cin >> a[i] >> b[i] >> c[i] >> d[i];
  for (int i = 0; i < T; ++i) {
    cout << zaikoTest(a[i], b[i], c[i], d[i]) << endl;
  }
}
