#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int a, b, c, d;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    int apple = a;
    int exist = a;
    int loop = a;
    int lunch = 1;
    while (1) {
      apple = exist;
      apple -= b;
      if (apple < 0) {
        lunch = 0;
        break;
      }
      if (apple <= c) {
        apple += d;
      }
      exist = apple;
      if (loop == exist) {
        cout << "Yes" << endl;
        break;
      }
    }
    if (!lunch) cout << "No" << endl;
  }
  return 0;
}
