n=int(input()) a=list(map(int,input().split())) mod=10**9+7 while len(a)>=2: b=[] for i in range(1,len(a)): b.append((a[i-1]+a[i])%mod) a=b print(*a)