#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
int t;
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    map<long long, bool> mp;
    if (a < b) {
      puts("No");
      continue;
    };
    long long cur = a - (a - c - 1) / b * b;
    while (true) {
      if (mp[cur]) {
        puts("Yes");
        break;
      }
      if (cur < b) {
        puts("No");
        break;
      }
      mp[cur] = true;
      cur = cur - b + d;
      if (cur > c + 1) cur = cur - (cur - c - 1) / b * b;
    }
  }
  return 0;
}
