import math from sys import stdin n, *a = map(int, stdin.read().split()) b = [] for i in range(n): if a[i] != 0: b.append(a[i]) m = len(b) if m <= 2: print("Yes") exit() b.sort() c = [b[i+1]-b[i] for i in range(m-1)] bgcd = c[0] for i in range(m-1): if c[i] == 0: bgcd = 0 break bgcd = math.gcd(bgcd,c[i]) if bgcd == 0: if max(b) != min(b): print("No") else: print("Yes") else: if (max(b) - min(b)) >= bgcd * n: print("No") else: print("Yes")