# -*- coding: utf-8 -*-

n,m = map(int,raw_input().split())

x = map(int, raw_input().split())
y = map(int, raw_input().split())

mod = 10**9+7
xsum = 0
ysum = 0
for i in range(n):
    xsum += (2*(i+1)-n-1)*x[i]

for i in range(m):
    ysum += (2*(i+1)-m-1)*y[i]
area = xsum*ysum%mod
print(area)