n = int(input()) a = list(map(int,input().split())) print("Yes" if len({v%n for v in a})==1 else "No")