a=b=m=s=0 for c in[*open(0)][1].split():c=int(c);m=[2,m+1][b+b==a+c];s+=s