#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
int main() {
  int T;
  cin >> T;
  while (T--) {
    unsigned long long int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No\n";
      continue;
    }
    unsigned long long int rem = A % B;
    if (rem > C && rem < B) {
      cout << "No\n";
      continue;
    }
    bool flag = 0;
    if (D < B) {
      cout << "No\n";
      continue;
    } else {
      unsigned long long int diff = D - B;
      if (diff == 0) {
        flag = 1;
      } else {
        unsigned long long int div = (unsigned long long int)((C - rem) / diff);
        unsigned long long int num = rem + div * diff;
        if (num <= C) num += diff;
        if (num < B) {
          flag = 0;
        } else {
          flag = 1;
        }
      }
    }
    if (!flag) {
      cout << "No\n";
      continue;
    }
    cout << "Yes\n";
  }
  return 0;
}
