#include <bits/stdc++.h>
using namespace std;
void judge(__int64_t a, __int64_t b, __int64_t c, __int64_t d) {
  int i;
  __int64_t prev_list[1000];
  int prev_index = 0;
  int flags = -1;
  prev_list[prev_index++] = a;
  while (1) {
    a = a - b;
    if (a < 0) {
      flags = 0;
      break;
    } else if (a <= c) {
      for (i = 0; i < prev_index; i++) {
        if (prev_list[i] == a) {
          flags = 1;
          break;
        }
      }
      if (flags == 1)
        break;
      else {
        prev_list[prev_index++] = a;
        a = a + d;
      }
    }
  };
  if (flags == 1) {
    cout << "Yes"
         << "\n";
  } else if (flags == 0) {
    cout << "No"
         << "\n";
  } else if (flags == -1) {
    cout << "error"
         << "\n";
  }
}
int main(int argc, char *argv[]) {
  int i;
  int T;
  cin >> T;
  __int64_t a[T], b[T], c[T], d[T];
  for (i = 0; i < T; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (i = 0; i < T; i++) {
    judge(a[i], b[i], c[i], d[i]);
  }
  return 0;
}
