in1 = list(input().split())
nx = int(in1[0])
ny = int(in1[1])
x = list(input().split())
y = list(input().split())
sx = sum([ int(x[i])*(2*i - nx + 1) for i in range(nx) ])
sy = sum([ int(y[i])*(2*i - ny + 1) for i in range(ny) ])
print(sx*sy%(10**9 + 7))