#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    int c1 = 0;
    if (a < b) {
      cout << "No\n";
      continue;
    }
    if (c >= b) {
      cout << "Yes\n";
      continue;
    }
    int dd = 0, flag = 0;
    long long ans = 0;
    while (1) {
      ans = -1;
      long long low = 1, high = 1e18;
      while (low <= high) {
        long long mid = (low + high) / 2;
        if ((a - (mid * b)) <= c && (a - (mid * b)) >= 0) {
          if (dd <= 10) {
          }
          ans = a - (mid * b);
          low = mid + 1;
        } else if ((a - (mid * b)) < 0) {
          high = mid - 1;
        } else {
          low = mid + 1;
        }
      }
      if (ans > c || ans < 0) {
        flag = 1;
        cout << "No\n";
        break;
      } else {
        dd++;
        a = ans + d;
      }
      if (dd == 1e6) break;
    }
    if (!flag) cout << "Yes\n";
  }
}
