#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int q, i, j, k;
  cin >> q;
  unsigned long long int a[q][4], b[q];
  for (i = 0; i < q; i++) {
    cin >> a[i][0];
    cin >> a[i][1];
    cin >> a[i][2];
    cin >> a[i][3];
  }
  for (i = 0; i < q; i++) {
    if (a[i][0] * a[i][2] < a[i][3]) {
      if ((a[i][0] * a[i][2]) + a[i][1] >= a[i][3]) {
        b[i] = 1;
      } else {
        b[i] = 0;
      }
    } else if (a[i][0] * a[i][2] > a[i][3]) {
      if ((a[i][3] / a[i][2]) * a[i][2] + a[i][1] >= a[i][3]) {
        b[i] = 1;
      } else {
        b[i] = 0;
      }
    } else {
      b[i] = 1;
    }
  }
  for (i = 0; i < q; i++) {
    if (b[i] == 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
