#include<bits/stdc++.h>

using namespace std;
using ll = long long;

int main(void){
    ll n, m;
    cin >> n >> m;
    vector<ll> x(n);
    for(auto& it : x) cin >> it;
    vector<ll> y(m);
    for(auto& it : y) cin >> it;

    ll X=0;
    for(int i=0;i<n;i++) {
        X += (n-2*i-1)*x[i];
        X %= 1000000007;
    }
    
    ll Y=0;
    for(int i=0;i<m;i++) {
        Y += (m-2*i-1)*y[i];
        Y %= 1000000007;
    }
    

    cout << X*Y%1000000007 << endl;

    return 0;
}