#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    unsigned long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (a % b > c) {
      cout << "No" << endl;
      continue;
    }
    if (a % b <= c) {
      if (a % b + d < b) {
        cout << "No" << endl;
        continue;
      }
      int flag = 0;
      unsigned long long check = a % b;
      unsigned long long k = max(b, c);
      for (int i = 1; i <= k; i++) {
        if ((check + d) % b > c || check + d < b) {
          flag = 1;
          break;
        }
        check = (check + d) % b;
      }
      if (flag == 1) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
}
