#include <iostream>
using namespace std;
using ll = long long;
constexpr int MOD = 1e9 + 7;

ll x[101010], y[101010];

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    ll n, m; cin >> n >> m;
    for(int i=0; i < n; ++i) cin >> x[i];
    for(int i=0; i < m; ++i) cin >> y[i];

    ll X = 0, Y = 0;
    for(int i=0; i < n/2; ++i) 
        (X += (n-1 - i*2) * (x[n-1-i] - x[i])) %= MOD;

    for(int i=0; i < m/2; ++i)
        (Y += (m-1 - i*2) * (y[m-1-i] - y[i])) %= MOD;

    cout << X * Y % MOD << '\n';
    return 0;
}