import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ FastScanner fsc=new FastScanner(); int N =fsc.nextInt(); fsc.close(); if (N%6==0) { System.out.println("Yes"); } else { System.out.println("No"); } } static class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private boolean hasNextByte(){ if(ptr Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next());} public void close(){ try{in.close();} catch(IOException e){e.printStackTrace();} } } }