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