#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  long long int a[T][4];
  for (int i = 0; i < T; i++) {
    cin >> a[i][0] >> a[i][1] >> a[i][2] >> a[i][3];
  }
  for (int i = 0; i < T; i++) {
    if (a[i][0] >= a[i][1] && a[i][2] >= a[i][1] && a[i][3] >= a[i][1]) {
      cout << "Yes" << endl;
      continue;
    } else if (a[i][0] < a[i][1] ||
               (a[i][0] >= a[i][1] && a[i][2] >= a[i][1] &&
                a[i][3] < a[i][1]) ||
               (a[i][0] >= a[i][1] && a[i][2] < a[i][1] && a[i][3] < a[i][1])) {
      cout << "No" << endl;
      continue;
    } else {
      long long int amari_first = a[i][0] % a[i][1];
      bool loop_hantei;
      bool flag;
      long long int tmp;
      if (amari_first > a[i][2] && amari_first < a[i][1]) {
        loop_hantei = false;
        flag = false;
      } else {
        flag = true;
        loop_hantei = true;
        tmp = amari_first + a[i][3];
      }
      int num = 0;
      while (loop_hantei && num <= a[i][1]) {
        int amari = tmp % a[i][1];
        if (amari == amari_first) {
          flag = true;
          break;
        } else if (amari > a[i][2] && amari < a[i][1]) {
          flag = false;
          break;
        } else {
          tmp = amari + a[i][3];
        }
        num++;
      }
      if (flag) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
