#include <bits/stdc++.h>
using namespace std;
int main() {
  int T = 0;
  cin >> T;
  string ans = "";
  long long A = 0;
  long long B = 0;
  long long C = 0;
  long long D = 0;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    if (B > D) {
      ans = "No";
    } else if (A > B && B < C) {
      ans = "Yes";
    } else {
      long long* p_tmp1 = new long long[1];
      long long* p_tmp2 = new long long[1];
      p_tmp1[0] = A;
      p_tmp2[0] = A;
      for (int i = 1; true; i++) {
        if (p_tmp2 != nullptr) {
          delete[] p_tmp2;
          p_tmp2 = nullptr;
        }
        p_tmp2 = new long long[i];
        p_tmp2 = p_tmp1;
        p_tmp2[i - 1] = A;
        if (p_tmp1 != nullptr) {
          delete[] p_tmp1;
          p_tmp1 = nullptr;
        }
        p_tmp1 = new long long[i];
        p_tmp1 = p_tmp2;
        p_tmp1[i - 1] = A;
        if (A < B) {
          ans = "No";
          break;
        }
        A %= B;
        if (A <= C) {
          A += D;
        }
        bool break_check = false;
        for (int j = 0; j < i; j++) {
          if (A == p_tmp2[j]) {
            ans = "Yes";
            break_check = true;
            break;
          }
        }
        if (break_check) {
          break;
        }
      }
      if (p_tmp1 != nullptr) {
        delete[] p_tmp1;
        p_tmp1 = nullptr;
      }
      if (p_tmp2 != nullptr) {
        delete[] p_tmp2;
        p_tmp2 = nullptr;
      }
    }
    cout << ans << endl;
  }
}
