#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL<<60;
#define all(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0; i<(n);++i)
#define FOR(i,k,n) for(int i=(k);i<(n);++i)

const ll MOD = 1000000007;

int main(){
    int n,m;cin>>n>>m;
    vector<ll> x(n),y(m);
    REP(i,n)cin>>x[i];
    REP(i,m)cin>>y[i];
    ll w=0,h=0;
    for(int i=n-1;i>=0;i--){w+=(x[i]+MOD)*(MOD+2*i-n+1);w%=MOD;}
    for(int i=m-1;i>=0;i--){h+=(y[i]+MOD)*(MOD+2*i-m+1);h%=MOD;}
    cout<<(h*w)%MOD<<endl;
    return 0;
}