#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int T;
  cin >> T;
  vector<long long> A, B, C, D;
  for (int i = 0; i < (T); i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    A.push_back(a);
    B.push_back(b);
    C.push_back(c);
    D.push_back(d);
  }
  for (int i = 0; i < (T); i++) {
    if (B[i] > D[i]) {
      cout << "No\n";
      continue;
    } else if (B[i] == D[i]) {
      if (A[i] % B[i] > C[i]) {
        cout << "No\n";
      } else {
        cout << "Yes\n";
      }
      continue;
    } else {
      if (A[i] < B[i]) {
        cout << "No\n";
        continue;
      }
      if (A[i] % B[i] > C[i]) {
        cout << "No\n";
        continue;
      } else {
        if (C[i] >= B[i] - 1) {
          cout << "Yes\n";
          continue;
        } else {
          long long s = A[i] % B[i];
          long long delta = D[i] % B[i];
          if (delta == 0) {
            cout << "Yes\n";
            continue;
          }
          if (((B[i] - 1) - s) / delta == 0) {
            cout << "Yes\n";
            continue;
          } else {
            if (s + ((B[i] - 1) - s) / delta * delta >= C[i] + 1) {
              cout << "No\n";
            } else {
              cout << "Yes\n";
            }
            continue;
          }
        }
      }
    }
  }
  return 0;
}
