#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  long long int a, b, c, d;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    bool buy = true;
    long long l = 1000;
    if (l > b) {
      l = b;
    }
    for (int k = 0; k <= l; k++) {
      if (a >= b) {
        a = a % b;
        if (a <= c) {
          a += d;
        }
      } else {
        buy = false;
        break;
      }
    }
    if (buy) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
