#include <bits/stdc++.h>
using namespace std;
int T;
long long A, B, C, D;
vector<long long> List;
bool flag;
long long mod, q;
int main() {
  cin >> T;
  cout << T << "\n";
  for (int i = 0; i < T; i++) {
    cout << i << "\n";
    cin >> A >> B >> C >> D;
    List = {};
    if (B > A) {
      cout << "No"
           << "\n";
      continue;
    }
    if (B > D) {
      cout << "No"
           << "\n";
      continue;
    }
    if (C > B) {
      cout << "Yes"
           << "\n";
      continue;
    }
    flag = false;
    while (true) {
      if (find(List.begin(), List.end(), A) != List.end()) {
        flag = true;
        break;
      }
      List.push_back(A);
      if (A < B) {
        flag = false;
        break;
      }
      mod = A % B;
      q = (A - mod) / B;
      A = mod;
      for (int i = 0; i < q - 1; i++) {
        if (A + B > C) break;
        A += B;
      }
      List.push_back(A + B);
      if (A <= C) A += D;
    }
    if (flag) {
      cout << "Yes"
           << "\n";
    } else {
      cout << "No"
           << "\n";
    }
  }
}
