#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順

int main() {
    ll N, M; cin >> N >> M;
    vector<ll> X(N), Y(M);
    rep(i,N) cin >> X.at(i);
    rep(i,M) cin >> Y.at(i);
    ll XA = 0, YA = 0;
    ll MOD = (ll)pow(10,9) + 7;
    for (ll i = 0; i < N; i++) XA += (i * X[i] - (N - 1 - i) * X[i]), XA %= MOD;
    for (ll i = 0; i < M; i++) YA += (i * Y[i] - (M - 1 - i) * Y[i]), YA %= MOD;
    cout << XA * YA % MOD << endl;
}
