import std; void main() { long N; readf("%d\n", N); auto A = readln.chomp.split.to!(long[]); A.sort!"a > b"; bool diff, diff0; long mx = A[0], mn = A[0]; long[] B; foreach (i; 1 .. N) { if (A[i] == 0) break; long d = A[i-1] - A[i]; (d > 0 ? diff : diff0) = true; B ~= d; mn = min(mn, A[i]); } bool isOK; if (!B.empty) { long g = B.fold!gcd; isOK = mx <= mn + g * (N - 1); if (diff && diff0) isOK = false; } writeln(isOK ? "Yes" : "No"); }