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