#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int mod = 1e9 + 7;
struct poi {
  int X;
  int Y;
  int Z;
  bool operator<(const poi& R) const {
    return X == R.X ? Y == R.Y ? Z < R.Z : Y < R.Y : X < R.X;
  }
};
long long GCD(long long a, long long b) {
  return (b == 0) ? (a) : (GCD(b, a % b));
}
long long LCM(long long a, long long b) { return a / GCD(a, b) * b; }
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << (0 % 2 ? "Yes" : "No") << endl;
      continue;
    }
    if (A % B > C || B > D) {
      cout << (0 % 2 ? "Yes" : "No") << endl;
      continue;
    }
    if (D % B == 0) {
      cout << (1 % 2 ? "Yes" : "No") << endl;
      continue;
    }
    bool f = true;
    for (int i = 0; i < 10000; i++) {
      if (A <= C) {
        A += D;
      }
      if (A < B) {
        cout << (0 % 2 ? "Yes" : "No") << endl;
        f = false;
        break;
      }
      A -= B;
    }
    if (f) {
      cout << (1 % 2 ? "Yes" : "No") << endl;
    }
  }
  return 0;
}
