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

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

x_list = []
y_list = []

for i in range(n):
    x_list.append(int(x_strs[i]))

for i in range(m):
    y_list.append(int(y_strs[i]))

width_list = []
height_list = []
for i_start in range(n):
    for i_end in range(i_start, n):
        width_list.append(x_list[i_end] - x_list[i_start])

for i_start in range(m):
    for i_end in range(i_start, m):
        height_list.append(y_list[i_end] - y_list[i_start])

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)
