#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll A[330];
ll B[330];
ll C[330];
ll D[330];
bool func(ll A, ll B, ll C, ll D) {
  ll x = A;
  for (int i = 0; i < 1000000; ++i) {
    if (x < B) {
      return false;
    }
    x = x % B;
    if (x > C) {
      return false;
    }
    x += D;
  }
  return true;
}
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < T; ++i) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
  }
  for (int i = 0; i < T; ++i) {
    if (func(A[i], B[i], C[i], D[i])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
