#include <iostream>
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;

int main()
{
    int n, m;
    cin >> n >> m;
    ll x[100005], y[100005];
    for(int i = 0; i < n; i++) cin >> x[i];
    for(int i = 0; i < m; i++) cin >> y[i];
    ll dx[100005], dy[100005];
    for(int i = 1; i < n; i++) dx[i] = x[i] - x[i - 1];
    for(int i = 1; i < m; i++) dy[i] = y[i] - y[i - 1];
    ll p = 0, q = 0;
    for(ll i = 1; i < n; i++) p = (p + i * (n - i) % MOD * dx[i]) % MOD;
    for(ll i = 1; i < m; i++) q = (q + i * (m - i) % MOD * dy[i]) % MOD;
    cout << p * q % MOD << endl;
}
