#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  vector<string> answers;
  scanf("%d", &T);
  for (int i = 0; i < T; i += 1) {
    long long A, B, C, D;
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    long long left = A % B, change = D - B;
    long long a;
    long double first = (long double)(C - left) / (long double)change;
    a = (long long)first + 1;
    long long number = a * change;
    if (left > C && left < B || A < B || left + D < B || change < 0 ||
        left + a * D - a * B > C && left + a * D - a * B < B) {
      answers.push_back("No");
      continue;
    }
    a -= 1;
    if (left + a * D - a * B > C && left + a * D - a * B < B) {
      answers.push_back("No");
      continue;
    }
    a += 2;
    if (left + a * D - a * B > C && left + a * D - a * B < B) {
      answers.push_back("No");
      continue;
    }
    answers.push_back("Yes");
  }
  for (auto ans : answers) {
    cout << ans << '\n';
  }
  return 0;
}
