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

//うますぎ
int main(){
    const ll mod = 1e9 + 7;
    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 xsum = 0,ysum = 0;
    rep(i,n){
        xsum = (xsum + i * x.at(i) - (n - i - 1) * x.at(i))% mod;
    }
    rep(i,m){
        ysum = (ysum + i * y.at(i) - (m - i - 1) * y.at(i))%mod;
    }
    ll ans = (xsum * ysum) % mod;
    cout << ans << endl;
    return 0;
}