#include <bits/stdc++.h>

using namespace std;

const auto MOD = (long long) 1e9 + 7;

int main() {
    int n, m;
    cin >> n >> m;

    long long ansX = 0;
    for (int i = 0; i < n; ++i) {
        long long x;
        cin >> x;
        ansX += (2 * i - n + 1) * x;
        ansX %= MOD;
    }

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

    cout << (ansX * ansY) % MOD << endl;
    return 0;
}
