in reply to if else in the other way

Another way:
print qw(no yes)[$a == 6]