import std; void main() { int N; readf("%d\n", N); writeln(N % 6 == 0 ? "Yes" : "No"); }