from math import gcd n = int(input()) A = list(map(int, input().split())) B = [] zero = 0 for a in A: if a != 0: B.append(a) else: zero += 1 if zero >= n - 1: print("Yes") exit() if len(set(B)) == 1: print("Yes") exit() B.sort() b0 = B[0] g = 0 for i, b in enumerate(B): B[i] -= b0 g = gcd(g, b - b0) B = [b // g for b in B] if len(set(B)) == len(B) and B[-1] < n: print("Yes") else: print("No")