#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < T; ++i) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "No" << endl;
      continue;
    }
    if (C >= B) {
      cout << "Yes" << endl;
      continue;
    }
    long long E = D % B;
    A = A % B;
    long long snum = A;
    A += E;
    while (true) {
      if (A >= B) {
        A %= B;
      }
      if (C < A && A < B) {
        cout << "No" << endl;
        break;
      }
      if (A == snum) {
        cout << "Yes" << endl;
        break;
      }
      A += (C - A + E) / E * E;
    }
  }
  return 0;
}
