#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    int c1 = 0;
    int dd = 0, flag = 0;
    long long ans = 0;
    while (1) {
      ans = -1;
      long long low = 1, high = 1e18;
      while (low <= high) {
        long long mid = (low + high) / 2;
        if ((a - (mid * b)) <= c && (a - (mid * b)) >= 0) {
          ans = a - (mid * b);
          low = mid + 1;
        } else if ((a - (mid * b)) < 0) {
          high = mid - 1;
        } else {
          low = mid + 1;
        }
      }
      if (ans > c || ans < 0) {
        flag = 1;
        printf("No\n");
        break;
      } else {
        dd++;
        a = ans + d;
      }
      if (dd == (75000)) break;
    }
    if (!flag) {
      printf("Yes\n");
    }
  }
}
