#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int T;
  std::cin >> T;
  long abcd[T][4];
  for (size_t i = 0; i < T; i++) {
    for (size_t i2 = 0; i2 < 4; i2++) {
      std::cin >> abcd[i][i2];
    }
  }
  for (size_t i = 0; i < T; i++) {
    if (abcd[i][0] < abcd[i][1]) {
      std::cout << "No" << '\n';
    } else {
      if (abcd[i][1] > abcd[i][3]) {
        std::cout << "No" << '\n';
      } else {
        if (abcd[i][1] < abcd[i][2] + 2) {
          std::cout << "Yes" << '\n';
        } else {
          int rangeB = abcd[i][1] - 1 - abcd[i][2];
          int attainable = 0;
          for (size_t b = 1; b < rangeB + 1; b++) {
            int acb = abcd[i][0] - abcd[i][2] - b;
            int B = abcd[i][1];
            acb = acb % B;
            int db = abcd[i][3] % B;
            for (size_t ix = 0; ix < B; ix++) {
              int zss = (acb + db * (ix + 1)) % B;
              if (zss == 0) {
                attainable = 1;
              }
            }
          }
          if (attainable == 1) {
            std::cout << "No" << '\n';
          } else {
            std::cout << "Yes" << '\n';
          }
        }
      }
    }
  }
  return 0;
}
