#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-11;
const long long MOD = 1000000007;
const double PI = 2 * acos(0.0);
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool flag = true;
    for (long long i = 0; i <= 1000000; i++) {
      if (a < b) {
        flag = false;
        break;
      } else {
        a -= b;
        if (a <= c) a += d;
      }
    }
    if (flag)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
