#include <bits/stdc++.h>
using namespace std;
map<long long, bool> visited;
int main() {
  int t;
  scanf("%d", &t);
  long long a, b, c, d;
  for (int i = 0; i < t; ++i) {
    bool flag = true;
    visited.clear();
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    while (true) {
      if (visited[a]) break;
      visited[a] = true;
      if (a - b < 0) {
        flag = false;
        break;
      }
      a -= b;
      if (a <= c) a += d;
    }
    printf("%s\n", flag ? "Yes" : "No");
  }
  return 0;
}
