#include <bits/stdc++.h>
using namespace std;
int mat[110][110];
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
      continue;
    }
    a = a % b;
    d = d % b;
    long long n1;
    if (d != 0)
      n1 = ((c - a) / d) + 1;
    else
      n1 = 0;
    long long val = a + n1 * d;
    if (val > c && val < b) {
      cout << "No" << endl;
    } else
      cout << "Yes" << endl;
  }
  return 0;
}
