#include <iostream>

typedef long long ll;
using namespace std;

ll x[100001];
ll y[100001];

const ll MOD = 1000000007;

ll calc(ll *x, int n) {
    ll sum = 0;
    for (int i = 1; i <= n; i ++) {
        ll y = (((ll)i * (n - i)) % MOD) * (x[i] - x[i-1]) % MOD;
        sum = (sum + y) % MOD;
    }
    return sum;
}

int main() {
    int 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];
    }
    cout << (calc(x, n) * calc(y, m)) % MOD << endl;
}