#include <bits/stdc++.h>
using namespace std;
vector<vector<long> > input(int N) {
  vector<vector<long> > vec;
  vec = vector<vector<long> >(N, vector<long>(4, 0));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 4; j++) {
      cin >> vec[i][j];
    }
  }
  return vec;
}
void output(string a) { cout << a << endl; }
void rng(vector<vector<long> > vec, int N) {
  int output = 0;
  int count = 0;
  int cur_color = -1;
  int flag = 0;
  for (int i = 0; i < N; i++) {
    long A = vec[i][0];
    long B = vec[i][1];
    long C = vec[i][2];
    long D = vec[i][3];
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (B <= C) {
      cout << "Yes" << endl;
      continue;
    }
    long amari = A % B;
    if ((amari + D) % B == 0) {
      cout << "Yes" << endl;
      continue;
    }
    int cnt = 100;
    int flag = 0;
    long aa = amari;
    while (cnt > 0) {
      aa = (aa + D) % B;
      if (aa > C) {
        cout << "No" << endl;
        flag = 1;
        break;
      }
      cnt--;
    }
    if (flag == 0) {
      cout << "Yes" << endl;
      continue;
    }
  }
  return;
}
int main() {
  int N;
  cin >> N;
  vector<vector<long> > A;
  A = input(N);
  rng(A, N);
}
