import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List

main :: IO ()
main = do
  solve <$> getl read <*> getl (map read . words) >>= putStrLn

solve :: Int -> [Int] -> String
solve n as = g as
  where
    f xs = zipWith (-) xs (rot (n - i) [1..n])
      where
        (Just i) = findIndex (== (minimum xs)) xs
    g xs = if all (== 0) ys then "YES" else if any (< 0) ys then "NO" else g ys
      where
        ys = f xs

rot :: Int -> [Int] -> [Int]
rot n xs = (drop n xs) ++ (take n xs)

getl :: (String -> a) -> IO a
getl f = f <$> getLine
