#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 (A < B) {
      answers.push_back("No");
      continue;
    }
    if (C >= B && D >= B) {
      answers.push_back("Yes");
      continue;
    }
    bool noNeed = false;
    for (int j = 0; j < 1300000; j += 1) {
      if (left < B && left > C) {
        answers.push_back("No");
        noNeed = true;
        break;
      }
      if (left <= C) {
        left += D;
      }
      if (left >= B) {
        left %= B;
      } else {
        answers.push_back("No");
        noNeed = true;
        break;
      }
    }
    if (!noNeed) {
      answers.push_back("Yes");
    }
  }
  for (auto ans : answers) {
    cout << ans << '\n';
  }
  return 0;
}
