#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int mod = 1000000007;

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N, M; cin >> N >> M;
    ll X[N], Y[M];
    rep(i, N) cin >> X[i];
    rep(i, M) cin >> Y[i];
    ll accx = 0, accy = 0;
    rep(i, N) accx = (accx + X[i]*(2*i+1-N)) % mod;
    rep(i, M) accy = (accy + Y[i]*(2*i+1-M)) % mod;
    cout << (accx*accy) % mod << endl;
    return 0;
}
