my $n = <STDIN>;
for (my $i=0; $i<$n; $i++){
        my ($A, $B, $C, $D) = map {$_ - 0} split(/\s+/o,<STDIN>);
        if ($B > $A) {
                print "No"."\n";
        } elsif ($B > $D) {
                print "No"."\n";
        } elsif ($B == $D) {
                if ($C < $A-$B) {
                        print "No"."\n";
                } else {
                        print "Yes"."\n";
                }
        } else {
                if ($A > $C) {
                        my $N2 = int(($A-$C)/$B);
                        $A = $A - $B*$N2;
                }
                if ($C < 2*$B && $D > $B) {
                        my $N3 = int($D/$B) - 1;
                        $D = $D - $B*$N3;
                }
                my $N = int(($C-$A+$B)/($D-$B)) + 1;
                if ($B > ($A-$B) + ($D-$B)*$N){
                        print "No"."\n";
                } else {
                        print "Yes"."\n";
                }
        }
}