#include<iostream>
#include<cstdio>
#define ll long long
#define MOD 1000000007
using namespace std;
ll x[100005],y[100005];
ll x1 = 0, y1 = 0;
int main(){
    int n,m; cin >> n >> m;
    cin >> x[0];
    for(int i = 1; i < n; i++){
        cin >> x[i];
        x1 += (x[i] - x[i-1]) * (n-i) * i;
        x1 %= MOD;
    }
    cin >> y[0];
    for(int i = 1; i < m; i++){
        cin >> y[i];
        y1 += (y[i] - y[i-1]) * (m-i) * i;
        y1 %= MOD;
    }
    ll ans = (x1 * y1) % MOD;
    cout << ans << endl;
    return 0;
}
