#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    set<int> vis;
    while (1) {
      if (a < b) {
        printf("No\n");
        goto End;
      }
      a %= b;
      if (a <= c) {
        if (vis.find(a) != vis.end()) {
          printf("Yes\n");
          goto End;
        }
        vis.insert(a);
        a += d;
      } else {
        printf("No\n");
        goto End;
      }
    }
  End:;
  }
  return 0;
}
