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