#include <bits/stdc++.h>
using namespace std;
unordered_map<long long, long long> mp;
int main() {
  long long i, j, x, y, n, m, z, sz, p, q, r, tc;
  scanf("%lld", &tc);
  while (tc--) {
    mp.clear();
    scanf("%lld", &x);
    scanf("%lld", &y);
    scanf("%lld", &z);
    scanf("%lld", &p);
    if (x < y) {
      printf("No\n");
      continue;
    }
    long long flg = 0;
    mp[x]++;
    while (flg < 100000) {
      flg++;
      x %= y;
      if (mp[x]) {
        printf("Yes\n");
        break;
      }
      mp[x]++;
      if (x <= z) {
        x += p;
      }
      if (x < y) {
        printf("No\n");
        break;
      }
    }
    if (flg == 100000) {
      printf("Yes\n");
    }
  }
  return 0;
}
