#include <bits/stdc++.h>
using namespace std;
int T;
long long a, b, c, d;
map<long long, bool> vis;
int main() {
  scanf("%d", &T);
  while (T--) {
    vis.clear();
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    while (true) {
      if (a < b) {
        printf("No\n");
        break;
      }
      a %= b;
      if (vis[a]) {
        printf("Yes\n");
        break;
      }
      vis[a] = 1;
      if (a <= c)
        a += d;
      else {
        printf("No\n");
        break;
      }
    }
  }
}
