#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "No" << endl;
      continue;
    } else if (C >= B) {
      cout << "Yes" << endl;
      continue;
    } else {
      long long apple = A;
      if ((D % B) == 0) {
        apple = apple % B;
        if (C + 1 <= apple) {
          cout << "No" << endl;
          continue;
        } else {
          cout << "Yes" << endl;
          continue;
        }
      } else if ((D % B) < (B - 1 - C)) {
        cout << "No" << endl;
        continue;
      }
      int flag = 1;
      for (int j = 0; j < B; j++) {
        apple = apple % B;
        if (C + 1 <= apple) {
          flag = 0;
          break;
        } else {
          apple += D;
        }
      }
      if (flag == 1) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
