#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (d < b) {
      cout << "No" << endl;
      continue;
    }
    if (c + 1 >= b) {
      cout << "Yes" << endl;
      continue;
    }
    bool ss = true;
    int cnt = 0;
    unordered_map<long long int, int> m;
    for (int i = 0; i <= 100000; i++) {
      m[a]++;
      if (m[a] > 1) cnt++;
      if (a < b) {
        ss = false;
        break;
      }
      a = a % b;
      if (a <= c) a += d;
    }
    if (ss)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
