N=int(input()) A=list(map(int, input().split())) ans=1 for i in range(N-1): d=A[i+1]-A[i] for j in range(i+1,N): if A[j]-A[j-1]!=d: break if ans