#!/usr/bin/env python3 import sys def main(): N = int(input()) A = list(map(int, input().split())) tot = 0 for aa in A[1:]: tot += (aa - A[0]) % N tot %= N print("YES" if tot == 0 else "NO") if __name__ == '__main__': main()