#include <iostream>
using namespace std;
typedef long long ll;
ll n, m, x[100100], y[100100], s, t;
const ll mod = 1000000007;
int main(void){
    // Your code here!
    cin >> n >> m;
    for (ll i = 0; i < n; i++) cin >> x[i];
    for (ll i = 0; i < m; i++) cin >> y[i];
    for (ll i = 1; i < n; i++) {
        (s += ((x[i] - x[i - 1]) * i * (n - i)) % mod) %= mod;
    }
    for (ll i = 1; i < m; i++) {
        (t += ((y[i] - y[i - 1]) * i * (m - i)) % mod) %= mod;
    }
    cout << (s * t) % mod << endl;
}
