#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, j;
  cin >> n;
  long long a[n][4];
  for (int i = 0; i < n; i++) {
    for (j = 0; j < 4; j++) {
      cin >> a[i][j];
    }
    for (j = 0; j < 100; j++) {
      if (a[i][0] < a[i][1]) {
        cout << "No" << endl;
        break;
      }
      a[i][0] = a[i][0] % a[i][1];
      if (a[i][0] <= a[i][2]) {
        a[i][0] += a[i][3];
      }
    }
    if (j == 100) {
      cout << "Yes" << endl;
    }
  }
}
