#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int i, T;
  cin >> T;
  long long a, b, c, d;
  for (i = 0; i < T; i++) {
    cin >> a >> b >> c >> d;
    long long k = a % b;
    if (k == 0) k = b;
    if (a < b || d < b) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    int t = a % b;
    int s = d % b;
    bool x = true;
    for (int i = 0; i < b; i++) {
      int u = t + i * s;
      if (u > c) x = false;
    }
    if (x) {
      cout << "Yes" << endl;
      continue;
    } else {
      cout << "No" << endl;
      continue;
    }
  }
}
