#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, max = 0, tmp;
  cin >> T;
  long a, b, c, d;
  for (int i = 0; i < T; i++) {
    max = 0;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    if ((a >= b) & (b <= d)) {
      for (int j = 0; j < b; j++) {
        tmp = (a % b + j * (d % b)) % b;
        if (max < tmp)
          max = tmp;
        else if (max == tmp & j > 0)
          break;
        else if (max == b - 1)
          break;
      }
      if (max <= c) {
        cout << "Yes" << endl;
        continue;
      }
    }
    cout << "No" << endl;
  }
  return 0;
}
