#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    unsigned long long a, b, c, d;
    cin >> a >> b >> c >> d;
    unsigned long long now = a % b;
    unsigned long long go = d - b;
    if (go < 0 || a < b || now > c) {
      cout << "No" << endl;
    } else if (go == 0) {
      if (a % b <= c)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else {
      map<long long, bool> mp;
      while (1) {
        if (mp[now] != 0) {
          cout << "Yes" << endl;
          break;
        }
        mp[now] = 1;
        if (now < 0) {
          cout << "No" << endl;
          break;
        }
        int so = (c - now) / go + 1;
        so = now + so * go;
        now = so;
        now %= b;
      }
    }
  }
  return 0;
}
