#include <bits/stdc++.h>
int main(void) {
  int T;
  scanf("%d", &T);
  int buy[300];
  long A, B, C, D;
  int old = 0;
  int flag = 0;
  for (int i = 0; i < T; i++) {
    int OldA[10000];
    flag = 0;
    OldA[0] = -1;
    old = 0;
    scanf("%d %d %d %d", &A, &B, &C, &D);
    while (flag == 0) {
      A = A - B;
      if (A < 0) {
        buy[i] = 0;
        flag = 1;
      } else if (A <= C) {
        for (int j = 0; j <= old; j++) {
          if (A == OldA[j]) {
            buy[i] = 1;
            flag = 1;
          }
        }
        OldA[old] = A;
        old++;
        OldA[old] = -1;
        A = A + D;
      }
    }
  }
  for (int k = 0; k < T; k++) {
    if (buy[k] == 1) {
      printf("yes\n");
    } else
      printf("no\n");
  }
  return 0;
}
