#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
using namespace std;
long long num[1000005];
long long n, m, p;
int main() {
  long long a, b, c, d;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
      if (a < b)
        printf("No\n");
      else {
        int flag = 0;
        for (int j = 1; j <= 100000; j++) {
          if (a < b) {
            printf("No\n");
            flag = 1;
            break;
          }
          a = a % b;
          if (a % b > c) {
            printf("No\n");
            flag = 1;
            break;
          } else {
            a += d;
          }
        }
        if (flag == 0) printf("Yes\n");
      }
    }
  }
}
