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