#include <bits/stdc++.h>
using namespace std;
int arr[1005];
int main(int argc, char* args[]) {
  int t;
  cin >> t;
  while (t--) {
    long long MaxCapacity, EverydayJuice, FillIfLess, NewCans;
    cin >> MaxCapacity >> EverydayJuice >> FillIfLess >> NewCans;
    bool g = false;
    if (MaxCapacity < EverydayJuice || NewCans < EverydayJuice) {
      cout << "No\n";
      continue;
    }
    for (int i = 1; i <= 100000; i++) {
      MaxCapacity %= EverydayJuice;
      if (MaxCapacity > FillIfLess) {
        cout << "No\n";
        g = true;
        break;
      }
      MaxCapacity += NewCans;
    }
    if (!g) cout << "Yes\n";
  }
}
