#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int T;
  long long a[310];
  long long b[310];
  long long c[310];
  long long d[310];
  int ans = 0;
  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 (a[i] < b[i]) {
      cout << "No" << endl;
    } else if (d[i] < b[i]) {
      cout << "No" << endl;
    } else if (c[i] >= b[i]) {
      cout << "Yes" << endl;
    } else if (b[i] == c[i] + 1) {
      cout << "Yes" << endl;
    } else {
      long long initial = a[i] % b[i];
      long long multi = d[i] % b[i];
      int flag = 1;
      for (int j = initial; j < b[i]; j += multi) {
        if (c[i] < j && j < b[i]) {
          cout << "No" << endl;
          flag = 0;
          break;
        }
        if (multi == 0) {
          break;
        }
      }
      if (flag == 1) {
        cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
