import java.util.Scanner object Main extends App { val sc = new Scanner(System.in) println(sc.nextInt % 90 match { case 0 => "Yes" case _ => "No" }) }