#include <bits/stdc++.h>
using namespace std;
int rp(long long int a, long long int b) {
  if (a == 0 or b == 0) return false;
  if (a % b == 0) return (b == 1) ? true : false;
  return rp(b, a % b);
}
int main() {
  int T;
  cin >> T;
  long long int A, B, C, D;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    long long int a = B - C;
    long long int d = D - B;
    long long int g = (A - C) % B;
    if (g == 0) g = B;
    if (B > D) {
      cout << "No" << endl;
      continue;
    }
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (B <= D and C >= B) {
      cout << "Yes" << endl;
      continue;
    }
    if (a == 1) {
      cout << "Yes" << endl;
      continue;
    }
    bool f = false;
    for (int j = 0; j < B + 1; j++) {
      if (g < a) {
        cout << "No" << endl;
        f = true;
        break;
      }
      g = (g + d) % B;
      if (g == 0) g = B;
    }
    if (!f) cout << "Yes" << endl;
  }
}
