{-# LANGUAGE OverloadedStrings #-} import Data.Maybe import qualified Data.ByteString.Char8 as C import Control.Monad(forM_) import Data.Int yes :: C.ByteString yes = "YES" no :: C.ByteString no = "NO" getInts :: IO [Int] getInts = do ss <- C.getLine return $ map (fst . fromJust . C.readInt) $ C.words ss -- end template -- main :: IO () main = do xs <- getInts ys <- getInts let ss = solve xs ys C.putStrLn ss solve :: [Int] -> [Int] -> C.ByteString solve [n,a] xs = if sum xs' == n' * a' then yes else no where xs' :: [Int64] xs' = map toEnum xs n' :: Int64 n' = toEnum n a' :: Int64 a' = toEnum a