#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define MOD 1000000007

ll calc(vector<ll> &x) {
    ll sum = 0;
    ll n = x.size();
    for(ll i = 1;i <= n;i++) {
        sum += (n - i) * x[i - 1] - (i - 1) * x[i - 1];
        sum %= MOD;
    }
    return sum;
}

int main(void) {
    ll n, m;
    vector<ll> x;
    vector<ll> y;
    cin >> n >> m;
    x.resize(n);
    y.resize(m);
    for(ll i = 0;i < n;i++) cin >> x[i];
    for(ll i = 0;i < m;i++) cin >> y[i];
    cout << calc(x) * calc(y) % MOD << endl;    
    return 0;
}
