#include <bits/stdc++.h>
int main() {
  char buff[1024];
  char *token;
  int num = 0, i, flag = 0, g, count = 0;
  long long int start, sa, mul;
  long long int a[300], b[300], c[300], d[300];
  fgets(buff, 1024, stdin);
  num = atoi(buff);
  for (i = 0; i < num; i++) {
    fgets(buff, 1024, stdin);
    token = strtok(buff, " ");
    a[i] = (long long int)strtoll(token, NULL, 0);
    while (token != NULL) {
      count++;
      token = strtok(NULL, " ");
      if (count == 1) {
        b[i] = (long long int)strtoll(token, NULL, 0);
      } else if (count == 2) {
        c[i] = (long long int)strtoll(token, NULL, 0);
      } else if (count == 3) {
        d[i] = (long long int)strtoll(token, NULL, 0);
      }
    }
    count = 0;
  }
  for (i = 0; i < num; i++) {
    if (a[i] < b[i]) {
      flag = 1;
    }
    if (d[i] >= b[i]) {
      sa = d[i] % b[i];
      start = a[i] % b[i];
      if (b[i] - c[i] >= 0) {
        if (sa == 0) {
          if ((c[i] < start) && (start < b[i])) {
            flag = 1;
          }
        } else {
          if (c[i] > start) {
            mul = (c[i] - start) / sa;
            start = start + sa * mul;
          }
          while (start < b[i]) {
            start = start + sa;
            if (c[i] < start && start < b[i]) {
              flag = 1;
              break;
            }
          }
        }
      }
    } else {
      flag = 1;
    }
    if (flag == 1) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
    flag = 0;
  }
  return 0;
}
