#include <bits/stdc++.h>
using namespace std;
const int N = 100002;
int t;
long long a, b, c, d;
int main() {
  scanf("%d", &t);
  while (t--) {
    cin >> a >> b >> c >> d;
    int i = 0;
    while (i < 1000000) {
      if (a < b) break;
      a -= b;
      if (a <= c)
        a += d;
      else {
        a -= (a - c) / b * b;
        if (a <= c) a += d;
      }
      ++i;
    }
    if (i == 1000000)
      puts("Yes");
    else
      puts("No");
  }
}
