import math n = int(input()) a = list(map(int, input().split())) s = [x for x in a if x != 0] if not s: print("Yes") else: k = len(s) if k == 1: print("Yes") else: s.sort() m = s[0] M = s[-1] g = 0 for i in range(1, k): d = s[i] - s[i-1] g = math.gcd(g, d) max_B = m + (n-1) * g if M > max_B: print("No") else: print("Yes")