#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  long long a, b, c, d;
  cin >> t;
  for (int ii = 0; ii < t; ii++) {
    cin >> a >> b >> c >> d;
    long long dc[1000] = {0};
    int res = 0;
    dc[0] = a;
    int i = 1;
    while (res == 0) {
      long long nig = a - b;
      if (nig <= c) {
        a = nig + d;
      } else
        a = nig;
      dc[i] = a;
      i++;
      for (int j = 0; j < i; j++) {
        for (int k = j + 1; k < i; k++) {
          if (dc[k] == dc[j]) {
            res = 1;
            break;
          }
        }
      }
      if (nig < 0) {
        res = 2;
      }
    }
    if (res == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
