# -*- coding: utf-8 -*-
import numpy as np
from numpy import array, matrix
N, M = [int(n) - 1 for n in input().split()]
pre_x_ = array([int(n) for n in input().split()])
pre_y_ = array([int(n) for n in input().split()])

x_ = pre_x_[1:N+1] - pre_x_[0:N]
y_ = pre_y_[1:M+1] - pre_y_[0:M]

x_length_arr = np.zeros(int(N * (N+1)/2))
y_length_arr = np.zeros(int(M * (M+1)/2))

x_past_sets = np.zeros(N)
y_past_sets = np.zeros(M)

for n in range(N):
    x_past_sets += array([x_[n]]*(n+1) + [0] * (N-n-1))
    x_length_arr[int(n*(n+1)/2):int((n+1)*(n+2)/2)] = x_past_sets[0:n+1]

for m in range(M):
    y_past_sets += array([y_[m]]*(m+1) + [0] * (M-m-1))
    y_length_arr[int(m*(m+1)/2):int((m+1)*(m+2)/2)] = y_past_sets[0:m+1]

x_length_mat = matrix(x_length_arr)
y_length_mat = matrix(y_length_arr)

print(int((y_length_mat.T.dot(x_length_mat)).sum())%(10**9+7))