#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    long a, b, c, d;
    scanf("%ld%ld%ld%ld", &a, &b, &c, &d);
    if (a < b) {
      printf("No\n");
    } else if (d < b) {
      printf("No\n");
    } else {
      if (a % b > c) {
        printf("No\n");
      } else if (b - 1 <= c) {
        printf("Yes\n");
      } else {
        int e = a % b;
        a = e + d;
        while (true) {
          a = a % b;
          if (a == e) {
            printf("Yes\n");
            break;
          } else if (a > c) {
            printf("No\n");
            break;
          }
          a = a + d;
        }
      }
    }
  }
  return 0;
}
