#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, m;
    const long int MOD = 1E9+7;
    long long int a = 0, b = 0, x, y;

    cin >> n >> m;

    for (int i = 0; i < n; i++) {
        cin >> x;
        a += (x*(i-(n-i-1)));
        a %= MOD;
    }
    for (int i = 0; i < m; i++) {
        cin >> y;
        b += (y*(i-(m-i-1)));
        b %= MOD;
    }
    cout << (a*b)%MOD << endl;

	return 0;
}
