num = int(input()) if num % 6 == 0: print('Yes') else: print('No')