n=int(input()) L=list(map(int,input().split())) flag=1 x=L[0]%n for e in L: if e%n!=x: flag=0 print("Yes" if flag else "No")