#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d;
  int t;
  scanf("%d", &t);
  while (t--) {
    long long x;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b) {
      printf("No\n");
      continue;
    }
    if (a > c) {
      long long k = (a - c) / b;
      while (a - k * b > c) k++;
      x = a - k * b;
    } else
      x = a - b;
    if (d < b) {
      printf("No\n");
      continue;
    }
    if (c >= b) {
      printf("Yes\n");
      continue;
    }
    bool flag = 1;
    int tmp = 50000;
    while (tmp--) {
      x = (x + d) % b;
      if (x > c) {
        flag = 0;
        break;
      }
    }
    if (flag == 0)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
