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