#include <bits/stdc++.h>
using namespace std;
const unsigned long long mod = 212370440130137957ll;
const int maxnode = 1000 * 100 + 10;
const int sigma_size = 28;
const unsigned long long base = 1e9 + 7;
map<long long, int> ash;
int main() {
  long long a, b, c, d;
  int t;
  scanf("%d", &t);
  while (t--) {
    ash.clear();
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b) {
      printf("No\n");
      continue;
    }
    int success = 0;
    while (1) {
      if (ash[a] == 1) {
        success = 1;
        break;
      }
      ash[a] = 1;
      if (a < b) break;
      long long remain = a % b;
      if (c < remain) break;
      a = remain + d;
    }
    if (success)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
