#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define ll long long
const ll mod = 1000000007;


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

    vector<ll> x(n), y(m);
    r(i, n) {
        cin >> x[i];
    }
    r(i, m) {
        cin >> y[i];
    }

    ll X = 0;
    r(i, n) {
        X += (2*i-n+1)*x[i];
        X %= mod;
    }

    ll Y = 0;
    r(i, m) {
        Y += (2*i-m+1)*y[i];
        Y %= mod;
    }

    cout << X*Y%mod << endl;
    return 0;
}
