#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long b[350][4];
  for (int a = 0; a < t; a++) {
    cin >> b[a][0] >> b[a][1] >> b[a][2] >> b[a][3];
  }
  for (int c = 0; c < t; c++) {
    long long d = b[c][0];
    int e = 0;
    while (e < b[c][2] + 2) {
      if (d - b[c][2] < 0) {
        cout << "No" << endl;
        goto A;
      }
      int f = (d - b[c][2]) % b[c][1];
      if (f)
        d = b[c][2] + f - b[c][1];
      else
        d = b[c][2];
      if (d < 0) {
        cout << "No" << endl;
        goto A;
      }
      d += b[c][3];
      e++;
    }
    cout << "Yes" << endl;
  A:;
  }
  return 0;
}
