inputer =int(input()) if inputer%6==0: print("Yes") else: print("No")