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