import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

n,m = MI()
x,y = LI(),LI()
mod = 10**9+7

n,m = n-1,m-1
dx = [x[i+1]-x[i] for i in range(n)]
dy = [y[i+1]-y[i] for i in range(m)]

if n % 2 == 0:
    rx = [n+i for i in range(n//2)] + [n+i for i in range(n//2-1,-1,-1)]
else:
    rx = [n+i for i in range(n//2)] + [n+(n//2)] + [n+i for i in range(n//2-1,-1,-1)]
if m % 2 == 0:
    ry = [m+i for i in range(m//2)] + [m+i for i in range(m//2-1,-1,-1)]
else:
    ry = [m+i for i in range(m//2)] + [m+(m//2)] + [m+i for i in range(m//2-1,-1,-1)]

a = 0
for i,j in zip(dx,rx):
    a += i*j
    a %= mod
b = 0
for i,j in zip(dy,ry):
    b += i*j
    b %= mod

print((a*b) % mod)
