#include <bits/stdc++.h>
using namespace std;
int T;
long long A, B, C, D, pos1, pos2, de;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    if (D < B) {
      printf("No\n");
      continue;
    }
    if (A < B) {
      printf("No\n");
      continue;
    }
    if (A > C) {
      A %= B;
      if (C - A < B)
        pos1 = A;
      else
        pos1 = A + (C - A) / B * B;
    } else
      pos1 = A;
    de = D - B;
    if (pos1 > C)
      pos2 = pos1;
    else {
      if (de == 0) {
        printf("Yes\n");
        continue;
      }
      pos2 = pos1 + de * ((C - pos1) / de + 1);
    }
    if (pos2 < B) {
      printf("No\n");
      continue;
    } else {
      printf("Yes\n");
      continue;
    }
  }
}
