#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  long long A[N][4];
  for (int i = 0; i < (N); i++) {
    for (int j = 0; j < (4); j++) {
      cin >> A[i][j];
    }
  }
  for (int i = 0; i < (N); i++) {
    if (A[i][0] < A[i][1] || A[i][1] > A[i][3]) {
      cout << "No" << endl;
    } else if (A[i][1] - A[i][2] < 2) {
      cout << "Yes" << endl;
    } else {
      int B[A[i][1]];
      for (int j = 0; j < (A[i][1]); j++) {
        B[j] = 0;
      }
      int factor = A[i][0] % A[i][1];
      while (factor <= A[i][2] && B[factor] != 1) {
        B[factor] = 1;
        factor = factor + A[i][3] % A[i][1];
      }
      if (factor > A[i][2] && factor < A[i][1]) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
