import itertools

def aaa(l):
    for i in xrange(len(l)-1):
        for j in xrange(i+1, len(l)):
            yield (l[i],l[j])


n,m=map(int,raw_input().split())
X=map(int,raw_input().split())
Y=map(int,raw_input().split())
X.sort()
Y.sort()
r=0
for xa,xb in aaa(X):
    for ya,yb in aaa(Y):
        r=(r+abs(xa-xb)*abs(ya-yb))%(1000000000+7)
print r
