#include <bits/stdc++.h>
using namespace std;
long long T, A, B, C, D;
int main() {
  cin >> T;
  while (T--) {
    cin >> A >> B >> C >> D;
    if (A < B) {
      printf("No\n");
      continue;
    }
    if (B > D)
      printf("No\n");
    else if (B == D) {
      A %= B;
      if (A > C && B > A)
        printf("No\n");
      else
        printf("Yes\n");
    } else {
      if (C + 1 >= B) {
        printf("Yes\n");
        continue;
      }
      int bl = 1;
      long long cur = A;
      for (int i = 1; i <= 200000; i++) {
        cur %= B;
        if (cur > C) {
          bl = 0;
          break;
        }
        cur += D - B;
      }
      if (bl)
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
  return 0;
}
