#include<iostream>
#include<vector>
using namespace std;

using ll = long long;
const ll MOD = 1e9+7;

int main() {
    int n, m;
    cin >> n >> m;
    ll xsum = 0, ysum = 0, x, y;
    for(int k = 0; k < n; k++) {
        cin >> x;
        xsum += (2 * k - n + 1) * x % MOD;
        xsum %= MOD;
    }

    for(int k = 0; k < m; k++) {
        cin >> y;
        ysum += (2 * k - m + 1) * y % MOD;
        ysum %= MOD;
    }

    ll ans = xsum * ysum % MOD;

    cout << ans << endl;

    return 0;
}