#include <bits/stdc++.h>
using namespace std;
long long t, n, a[400], b[400], c[400], d[400], res;
set<long long> s[400];
signed main() {
  cin >> t;
  for (long long i = 0; i < t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (long long i = 0; i < t; i++) {
    if (b[i] > a[i]) {
      printf("No\n");
      continue;
    }
    if (b[i] > d[i]) {
      printf("No\n");
      continue;
    }
    if (c[i] >= b[i]) {
      printf("Yes\n");
      continue;
    }
    if (d[i] == b[i]) {
      if (a[i] - b[i] > c[i] && a[i] - b[i] < b[i]) {
        printf("No\n");
      } else {
        printf("Yes\n");
      }
      continue;
    }
    long long aa = b[i] - a[i];
    while (1) {
      n = (c[i] - aa + d[i] - b[i]) / (d[i] - b[i]) + 1;
      res = aa + (d[i] - b[i]) * (n - 1);
      if (res < b[i]) {
        printf("No\n");
        break;
      } else {
        aa = res - b[i];
      }
      if (s[i].count(aa)) {
        printf("Yes\n");
        break;
      } else {
        s[i].insert(aa);
      }
    }
  }
  return 0;
}
