#include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

using ll = long long;
const ll MOD = 1e9 + 7;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> x(n), y(m);
    rep(i, n) cin >> x[i];
    rep(i, m) cin >> y[i];
    ll xsum = 0;
    rep(i, n - 1) {
        ll dx = ((1L + i) * (n - i - 1)) % MOD;
        xsum += dx * (x[i + 1] - x[i]);
        xsum %= MOD;
    }
    ll ysum = 0;
    rep(i, m - 1) {
        ll dy = ((1L + i) * (m - i - 1)) % MOD;
        ysum += dy * (y[i + 1] - y[i]);
        ysum %= MOD;
    }
    cout << (xsum * ysum) % MOD << endl;
}