import java.util.*; class Main{ public static void main(String[] args) { try(Scanner sc = new Scanner(System.in)){ int num = Integer.parseInt(sc.next()); if(num % 6 == 0) System.out.println("Yes"); else System.out.println("No"); }catch(Exception e){ e.printStackTrace(); } } }