print(io.read("*n") % 6 == 0 and "Yes" or "No")