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

def listsum(l):
    ret = 0
    n = len(l)
    for k, v in enumerate(l):
        ret += k * v
        ret -= (n - k - 1) * v
    return ret

ans = listsum(xl) * listsum(yl)
ans %= (10 ** 9 + 7)
print ans
