import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	int n = readln.chomp.to!int;
	long[] as = readln.chomp.split.map!(to!long).array;
	
	BigInt sum;
	foreach(a; as) sum += a;
	
	BigInt u = n * (n + 1) / 2;
	
	string ans;
	if(sum % u != 0) ans = "NO";
	else{
		BigInt c = sum / u;
		BigInt k = 0;
		
		ans = "YES";
		
		as ~= as[0];
		for(int i = 0; i < n; i ++){
			BigInt d = as[i + 1] - as[i];
			if((c - d) % n != 0){
				ans = "NO";
				break;
				}
			k += (c - d) / n;
			}
		
		if(k != c) ans = "NO";
		}
	
	ans.writeln;
	
	}