import Control.Applicative ((<$>))
import Data.List (sort)

main = do
  n <- read <$> getLine :: IO Int
  as <- map read.words <$> getLine :: IO [Int]
  let m = n*(n+1)`div`2
      s = sum as
      diffs = zipWith (-) (tail as) as
  case s `divMod` m of
    (d,0) -> putStrLn $ if any (\x->if x > 0 then x==d else or [x==d-y*n|y<-[1..d]]) diffs then "YES" else "NO"
    _ -> putStrLn "NO"
