#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
void solve() {
  cin >> a >> b >> c >> d;
  int flag = 1;
  if (a < b) {
    flag = 0;
  } else if (a % b > c) {
    flag = 0;
  } else {
    if (d < b) {
      flag = 0;
    } else if (d % b != 0 && b > c + 1) {
      long long x;
      int cnt = 0;
      a %= b;
      d %= b;
      while (cnt <= 100000 && flag) {
        if (a > c) flag = 0;
        x = b - (b - a) % d;
        if (x == b) x = b - d;
        if (x > c) flag = 0;
        x = (x + d) % b;
        cnt++;
      }
    }
  }
  if (flag)
    puts("Yes");
  else
    puts("No");
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
