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

constexpr int mod = 1e9 + 7;

int main()
{
    int n,m;
    cin>>n>>m;
    vector<ll>x(n),y(m);
    for(auto &i:x){
        cin>>i;
    }
    for(auto &i:y){
        cin>>i;
    }
    ll xs=0;
    for(int i=1;i<=n;++i){
        xs+=(i-1)*x[i-1]-(n-i)*x[i-1];
        xs%=mod;
    }
    ll ys=0;
    for(int i=1;i<=m;++i){
        ys+=(i-1)*y[i-1]-(m-i)*y[i-1];
        ys%=mod;
    }
    cout<<(xs*ys)%mod<<endl;
}