#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int count = 0;
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a >= b) {
      while (1) {
        a = a - b;
        if (a <= -1) {
          cout << "No" << endl;
          break;
        }
        if (a <= c) a = a + d;
        count++;
        if (count == 10000) {
          cout << "Yes" << endl;
          break;
        }
      }
    } else
      cout << "No" << endl;
  }
  return 0;
}
