using System; class Program { static void Main(string[] args) { var N = int.Parse(Console.ReadLine()); if (N % 6 == 0) Console.WriteLine("Yes"); else Console.WriteLine("No"); } }