#include <bits/stdc++.h>
using namespace std;
int T;
long long a, b, c, d;
bool flag = true;
int ind;
long long *A;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> T;
  for (int i = 0; i < T; ++i) {
    cin >> a >> b >> c >> d;
    ind = 0;
    A = new long long[300];
    while (flag) {
      A[ind] = a;
      ind++;
      a -= b;
      A[ind] = a;
      ind++;
      if (a < 0) {
        cout << "No" << endl;
        break;
      }
      if (a <= c) {
        a += d;
        A[ind] = a;
        ind++;
      }
      for (int j = 0; j < ind; j += 2) {
        if (A[j] == a) {
          cout << "Yes" << endl;
          flag = false;
          break;
        }
      }
    }
    delete[] A;
  }
  return 0;
}
