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

#define LL long long
const int mod = 1e9 + 7;

int main() {
    ios::sync_with_stdio(0), cin.tie(0);
    
    LL n, m, x, a=0, b=0;
    cin >> n >> m;

    for(LL i = 1; i <= n; i++) cin >> x, (a += ((i-1) * x) % mod) %= mod, (a += mod - ((n-i) * x) % mod) %= mod;

    for(LL i = 1; i <= m; i++) cin >> x, (b += ((i-1) * x) % mod) %= mod, (b += mod - ((m-i) * x) % mod) %= mod;

    cout << (a * b) % mod;    
}