#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
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)
      cout << "NO" << endl;
    else if (B == D) {
      int t = (A - C) / B + ((A - C) % B == 0 ? 0 : 1);
      if (A - B * t >= 0)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else if (B > D)
      cout << "NO" << endl;
    else {
      int cnt = (A % 2 == 1) + (B % 2 == 1) + (D % 2 == 1);
      if (cnt % 2) {
        if (B % 2 == C % 2) {
          if (C >= B - 1)
            cout << "YES" << endl;
          else
            cout << "NO" << endl;
        } else {
          if (C >= B - 2)
            cout << "YES" << endl;
          else
            cout << "NO" << endl;
        }
      } else {
        if (B % 2 == C % 2) {
          if (C >= B - 2)
            cout << "YES" << endl;
          else
            cout << "NO" << endl;
        } else {
          if (C >= B - 1)
            cout << "YES" << endl;
          else
            cout << "NO" << endl;
        }
      }
    }
  }
  return 0;
}
