n = int(input()) ans = 0 mod = 10**9+7 for i in range(n): ans += int(input()) ans %= mod print(ans)