#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  long long r = x % y;
  while (r != 0) {
    x = y;
    y = r;
    r = x % y;
  }
  return y;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool ans = a >= b && d >= b && c >= a % b;
    if (ans) {
      if (a % 2 == 1) {
        if (c < b - gcd(b, d)) {
          ans = false;
        }
      } else if (b % 2 == 1) {
        if (d % b != 0) {
          if (c < b - 1) {
            ans = false;
          }
        }
      } else {
        if (d % b != 0) {
          if (d % 2 == 1) {
            if (c < b - 1) {
              ans = false;
            }
          } else {
            if (c < b - 2) {
              ans = false;
            }
          }
        }
      }
    }
    if (ans) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
