#!/usr/bin/perl

my ($t) = map {$_ - 0} split(/\s+/o,<STDIN>);
my @d = ();
for(my $i=0;$i<$t;$i++){
  my ($a,$b,$c,$d) = map {$_ - 0} split(/\s+/o,<STDIN>);
  if( $a < $b or $d < $b ){ print "No\n"; next; }
  if( $c + 1 >= $b ){ print "Yes\n"; next; }
  # $c + 1 < $b
  my $v1 = ( $a - $c ) % $b;
  my $v2 = ( $v1 == 0 ? $c : $c + $v1 - $b );
  if( $v2 < 0 ){ print "No\n"; next; }
  my $v3 = $d % $b;
  if( $v3 == 0 ){ print "Yes\n"; next; }
  my $v4 = $b % $v3;
  if( $v4 != 0 ){ print "No\n"; next; }
  my $v5 = ( $c - $v2 ) % $v3;
  if( $c + ( $v3 - $v5 ) - $b < 0 ){ print "No\n"; next; }
  print "Yes\n";
}

exit(0);

