#include <bits/stdc++.h>
using namespace std;
int n, ans, fi;
long long a, b, c, d;
bool f(long long x, long long y) {
  if (y > a) return 1;
  if (fi && x == a) return 1;
  if (x % b > c || b > x) return 0;
  fi = 1;
  return f(x % b + d, y + 1);
}
int main() {
  scanf("%d", &n);
  while (n--) {
    fi = ans = 0;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (b <= c) ans = 1;
    ans = f(a, 0);
    if (ans)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
