M=10**9+7

n=int(eval(input()))

l=[*list(map(int,input().split()))]

print(((sum(i for i in l)**2-sum(i**2 for i in l))//2%M))
n,*l=list(map(int,open(0).read().split()))

print(((sum(l)**2-sum(i**2 for i in l))//2%(10**9+7)))
M = 10**9 + 7
n = int(eval(input()))
l = [*list(map(int, input().split()))]
print(((sum(i for i in l) ** 2 - sum(i**2 for i in l)) // 2 % M))

n, *l = list(map(int, open(0).read().split()))
print(((sum(l) ** 2 - sum(i**2 for i in l)) // 2 % (10**9 + 7)))

-M = 10**9 + 7 -n = int(eval(input())) -l = [*list(map(int, input().split()))] -print(((sum(i for i in l) ** 2 - sum(i**2 for i in l)) // 2 % M)) +n, *l = list(map(int, open(0).read().split())) +print(((sum(l) ** 2 - sum(i**2 for i in l)) // 2 % (10**9 + 7)))