#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (long long a, b, c, d; cin >> a >> b >> c >> d;) {
    if (a < b || d < b) {
      cout << "No\n";
    } else {
      string result = "Yes\n";
      long long p1 = a % b, p2 = p1;
      do {
        if (p1 > c) {
          result = "No\n";
          break;
        }
        p1 = (p1 + d) % b;
        p2 = (p2 + d) % b;
        p2 = (p2 + d) % b;
      } while (p1 != p2);
      cout << result;
    }
  }
  return 0;
}
