#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const double EPS = 1e-10;
const int INF = 2147483647;
void solve(long long a, long long b, long long c, long long d) {
  for (int i = 0; i < 30000; i++) {
    if (a < b) {
      cout << "No" << endl;
      return;
    }
    int flag = 0;
    if (a >= c) {
      a -= c;
      flag = 1;
    }
    int take = 0;
    if (a >= b) take = 1;
    a = a % b;
    if (flag) a += c;
    if (a < b && take == 0) {
      cout << "No" << endl;
      return;
    } else {
      if (a >= b && take == 0) a -= b;
    }
    if (a <= c) {
      a += d;
    }
  }
  cout << "Yes" << endl;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    solve(a, b, c, d);
  }
  return 0;
}
