import java.util.Scanner; public class No1003 { public static void main(String[] args) { int n; Scanner sc = new Scanner(System.in); n = Integer.parseInt(sc.next()); sc.close(); if (n % 6 == 0) { System.out.println("Yes"); } else{ System.out.println("No"); } } }