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

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef pair<ll, ll> PLL;

signed main() {
    ll M=1e9+7;
    ll n,m;
    cin>>n>>m;
    vector<ll> x(n),y(m);
    rep(i,0,n) cin>>x[i];
    rep(i,0,m) cin>>y[i];

    ll W=0;
    rep(i,0,n){
        W += i*x[i] - (n-1-i)*x[i];
        W %= M;
    }

    ll H=0;
    rep(i,0,m){
        H += i*y[i] - (m-1-i)*y[i];
        H %= M;
    }

    cout<<W*H%M<<endl;
    return 0;
}
