#yuki1003 n=int(input()) if n%6 or n==0: print('No') else: print('Yes')