# coding=utf-8

line = input().split(" ")
n = int(line[0])
m = int(line[1])

x = 0
for (k,nn) in enumerate(input().split(" ")):
    nn = int(nn)
    x += k*nn - (n-k-1)*nn

y = 0
for (k,nn) in enumerate(input().split(" ")):
    nn = int(nn)
    y += k*nn - (n-k-1)*nn

print((x*y)%(10**9+7))
