#include <bits/stdc++.h>
int main(void) {
  long long int ini, buy, limit, ext, drink;
  int q_num, q, ecount, flag;
  scanf("%d", &q_num);
  for (q = 0; q < q_num; q++) {
    scanf("%lld %lld %lld %lld", &ini, &buy, &limit, &ext);
    drink = ini;
    ecount = 0;
    flag = 0;
    while (1) {
      if (drink - limit > buy) {
        drink = limit + (drink - limit) % buy;
      }
      drink -= buy;
      if (drink < 0) {
        flag = -1;
        break;
      }
      drink += ext;
      ecount++;
      if (ecount == 1000) {
        break;
      }
    }
    if (flag == 0) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
