#include <bits/stdc++.h>
using namespace std;
set<long long> s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t, a, b, tp = 100000, c, d, flag, i;
  cin >> t;
  while (t--) {
    s.clear();
    flag = 1;
    cin >> a >> b >> c >> d;
    if (d < b) {
      cout << "No\n";
      continue;
    }
    for (i = 1; i <= tp; i++) {
      if (a < b) {
        flag = 0;
        break;
      } else {
        if (s.find(a) != s.end()) break;
        s.insert(a);
        a = a % b;
        if (a > c) {
          flag = 0;
          break;
        }
        a += d;
      }
    }
    if (flag == 0)
      cout << "No\n";
    else
      cout << "Yes\n";
  }
  return 0;
}
