#include <bits/stdc++.h>
using namespace std;
int vx[] = {0, 0, -1, 1};
int vy[] = {1, -1, 0, 0};
int dx[] = {1, 0, -1, 1, -1, 1, 0, -1};
int dy[] = {1, 1, 1, 0, 0, -1, -1, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
const long long mod = 1e9 + 7;
const int INF = INT_MAX / 2;
const int N_MAX = 100010;
int main() {
  int t;
  cin >> t;
  bool ans[t];
  for (int time = 0; time < t; time++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    ans[time] = true;
    if (a < b)
      ans[time] = false;
    else if (a % b > c) {
      ans[time] = false;
    } else if (d < b) {
      ans[time] = false;
    } else {
      for (int j = 0; j < 1000; j++) {
        if (a % b > c) {
          ans[time] = false;
          break;
        }
        a = a % b;
        a += d;
      }
    }
  }
  for (int i = 0; i < int(t); i++) {
    if (ans[i])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
