#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    map<long long, int> mp;
    if (a < b || b > d) {
      cout << "No\n";
      continue;
    }
    if (c >= b) {
      cout << "Yes\n";
      continue;
    }
    while (mp[a] == 0 && a >= b) {
      mp[a] = 1;
      a %= b;
      if (a <= c) a += d;
    }
    if (mp[a]) {
      cout << "Yes\n";
    } else
      cout << "No\n";
  }
  return 0;
}
