#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;

int main(){
    ll n,m,sx=0,sy=0;
    cin >> n >> m;
    for(int i = 0;i < n;i ++){
        ll x;
        cin >> x;
        sx += (2*i+1-n)*x;sx %= mod;
    }
    for(int i = 0;i < m;i ++){
        ll y;
        cin >> y;
        sy += (2*i+1-m)*y;sy %= mod;
    }
    cout << (sx*sy)%mod << endl;
    return 0;
}