import sys import math def get_divisors(n): divisors = set() for i in range(1, int(math.isqrt(n)) + 1): if n % i == 0: divisors.add(i) divisors.add(n // i) return sorted(divisors) def main(): N, *rest = map(int, sys.stdin.read().split()) A = rest[:N] S = [x for x in A if x > 0] if not S: print("Yes") return if len(S) == 1: print("Yes") return all_equal = True first = S[0] for x in S: if x != first: all_equal = False break if all_equal: print("Yes") return S.sort() diffs = [] for i in range(1, len(S)): diffs.append(S[i] - S[i-1]) def compute_gcd(list_numbers): current_gcd = list_numbers[0] for num in list_numbers[1:]: current_gcd = math.gcd(current_gcd, num) if current_gcd == 0: break return current_gcd g = compute_gcd(diffs) divisors = get_divisors(g) for d in divisors: if d <= 0: continue r = S[0] % d valid = True for x in S: if x % d != r: valid = False break if not valid: continue a = S[0] if a + (N-1)*d >= S[-1]: print("Yes") return print("No") if __name__ == "__main__": main()