//
// D - 井井井 / ###
//

#include <iostream>

using namespace std;
using LL = long long;

const LL MOD = 1000000007;

int main() {

    int n, m;
    cin >> n >> m;

    LL xx = 0, yy = 0;

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

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

    cout << (xx * yy) % MOD << endl;
}