#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int test;
  cin >> test;
  while (test--) {
    unsigned long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    long long int s = a;
    map<long long int, long long int> ch;
    while (ch[s] == 0) {
      ch[s] = 1;
      s = s - b;
      if (s < 0) {
        cout << "No" << endl;
        break;
      }
      if (s <= c) {
        s += d;
      }
    }
    if (s >= 0) cout << "Yes" << endl;
  }
}
