s, t = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

def calc(li):
    div = 10 ** 9 + 7
    li_size = len(li)
    su_m = 0
    for k in range(li_size):
        su_m += ((2 * k + 1 - li_size) * li[k] ) % div
    return su_m

x_sum = calc(x)
y_sum = calc(y)
print((x_sum * y_sum ) % (10 ** 9 + 7))