#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
int main() {
  int q;
  cin >> q;
  while (q--) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    bool F = true;
    int Cnt = 0;
    long long int p, x;
    while (Cnt <= 500000) {
      Cnt++;
      p = a / b;
      x = a % b;
      if (!p) {
        F = false;
        break;
      }
      if (x <= c)
        a = x + d;
      else
        a = x;
    }
    if (F)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
