N = gets.to_i if N == 2 puts 'Yes' exit end dp = Array.new(N + 1, nil) n = N if N % 2 == 0 dp[n] = false n -= 1 while n > 0 dp[n] = true n -= 1 n.downto(n - 2) do |x| dp[x] = false end n = n - 3 end else dp[n] = true n -= 1 while n > 0 n.downto(n - 2) do |x| dp[x] = false end n = n - 3 if n > 0 dp[n] = true n -= 1 end end end if dp[1..3].include?(true) puts 'Yes' else puts 'No' end