#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    set<long long int> s;
    long long int k = a % b;
    s.insert(k);
    bool check = 0;
    while (k <= c) {
      k += d;
      if (k < b) {
        break;
      }
      k %= b;
      if (binary_search(s.begin(), s.end(), k)) {
        cout << "Yes" << endl;
        check = 1;
        break;
      }
    }
    if (check == 0) {
      cout << "No" << endl;
    }
  }
}
