#include <bits/stdc++.h>
int hyouji(int A, int B, int C, int D) {
  int i, l;
  if (A < B) {
    printf("No\n");
  } else {
    for (i = 0; i < B; i = i + 1) {
      l = A % B;
      if (C < l) {
        printf("No\n");
        goto End;
      } else if (l + D < B) {
        printf("No\n");
        goto End;
      }
      A = l + D;
    }
    printf("Yes\n");
  }
End:
  return 0;
}
int main(void) {
  int NUM[3];
  int n, m, i;
  scanf("%d", &n);
  for (m = 0; m < n; m = m + 1) {
    for (i = 0; i < 4; i = i + 1) {
      scanf("%d", &NUM[i]);
    }
    hyouji(NUM[0], NUM[1], NUM[2], NUM[3]);
  }
  return 0;
}
