N=int(input()) A=list(map(int,input().split())) if all(a%N==A[0]%N for a in A): ans="Yes" else: ans="No" print(ans)