import itertools
import math

nm = str(input()).split(' ')
xAry = str(input()).split(' ')
yAry = str(input()).split(' ')

result = 0

nRange = range(int(nm[0]))
mRange = range(int(nm[1]))
nList = itertools.combinations(nRange,2)
mList = itertools.combinations(mRange,2)

for n in nList:
    for m in mList:
        result += (int(xAr[n[1]]) - int(xAry[n[0]])) * (int(yAry[m[1]]) - int(yAry[m[0]]))

'''
for ms in range(int(nm[1])-1):
    for me in range(ms+1,int(nm[1])):
        for ns in range(int(nm[0])-1):
            for ne in range(ns+1,int(nm[0])):
                #print('%s,%s,%s,%s'%(ms,me,ns,ne))
                result += (int(yAry[me])-int(yAry[ms]))*(int(xAry[ne])-int(xAry[ns]))
'''

result %= 1000000007

print(result)