n,m = input().split()
n = int(n)
m = int(m)
x_list =list()
y_list = list()

x_list= input().split()
y_list= input().split()

for i in range(n):
    x_list[i] = int(x_list[i])

for i in range(m):
    y_list[i] = int(y_list[i])

all_menseki = 0
waru = 10**9 + 7
amari = 0
for x_min_i,x_min in enumerate(x_list[:-1]):
    for x_max in x_list[x_min_i:]:
        for y_min_i,y_min in enumerate(y_list[:-1]):
            for y_max in y_list[y_min_i:]:
                x = x_max - x_min
                y = y_max - y_min
                amari = (amari + (x % waru) * (y % waru)) % waru    

print(amari)
