import std; void main(){ auto n = readln.chomp.to!int; auto a = readln.chomp.split.to!(int[]); auto b = a.filter!(x => x != 0).array.sort; if(b.length < 2){ writeln("Yes"); return; } auto m = b[1] - b[0]; bool f = (b[0] == b[1]); for(auto i = 1; i < b.length - 1; i++){ auto d = b[i + 1] - b[i]; if(f){ if(d > 0){ m = -1; break; } }else{ if(d == 0){ m = -1; break; } m = m.gcd(d); } } stderr.writeln(m); if(b[$ - 1] - b[0] <= m * (n - 1)){ writeln("Yes"); }else{ writeln("No"); } }