#include <bits/stdc++.h>
using namespace std;
bool solve(long long A, long long B, long long C, long long D) {
  if (B > D) {
    return false;
  }
  if (B <= C) {
    if (A >= B) {
      return true;
    } else {
      return false;
    }
  }
  if (A < B) {
    return false;
  }
  for (int j = 0; j < 100000; j++) {
    if (A >= C) {
      long long diff = ((A - C - 1) / B + 1) * B;
      A -= diff;
    } else {
      A -= B;
    }
    if (A < 0) {
      return false;
    } else if (A <= C) {
      A += D;
    }
  }
  return true;
}
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (solve(A, B, C, D)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
