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

x_strs = input().split()
y_strs = input().split()

x_list = []
y_list = []
width_list = []
height_list = []

for i in range(n):
    x = int(x_strs[i])
    x_list.append(x)
    for x_ in x_list:
        width_list.append(x - x_)

for i in range(m):
    y = int(y_strs[i])
    y_list.append(y)
    for y_ in y_list:
        height_list.append(y - y_)

sum_squire = 0

for w in width_list:
    for h in height_list:
        sum_squire += w * h

ans = sum_squire % (10**9 + 7)
print(ans)
