n=int(input()) x = list(map(int,input().split())) mod=10**9+7 print(sum(x)%mod)