#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long a, b, c, d;
  long long tmp;
  bool flag;
  for (int q = 0; q < t; q++) {
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
      continue;
    }
    if (a % b > c) {
      cout << "No" << endl;
      continue;
    }
    tmp = a % b + d;
    flag = false;
    while (a % b != tmp % b) {
      if (tmp % b > c) {
        cout << "No" << endl;
        flag = true;
        break;
      }
      tmp = tmp % b + d;
    }
    if (flag) continue;
    cout << "Yes" << endl;
  }
  return 0;
}
