import kotlin.system.exitProcess val br = System.`in`.bufferedReader() fun readLine(): String? = br.readLine() fun readString() = readLine()!! fun readInt() = readString().toInt() const val MAX_STACK_SIZE: Long = 128 * 1024 * 1024 fun main() { val thread = Thread(null, ::run, "solve", MAX_STACK_SIZE) thread.setUncaughtExceptionHandler { _, e -> e.printStackTrace(); exitProcess(1) } thread.start() } fun run() { val N = readInt() output(solve(N)) } fun solve(N: Int): Boolean = N % 6 == 0 fun output(res: Boolean) { println(if (res) "Yes" else "No") }