#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}
ll modpow(ll a, ll p) {
    if(p == 0)
        return 1;
    if(p % 2 == 0) {
        ll halfp = p / 2;
        ll half = modpow(a, halfp);
        return half * half % MOD;
    } else {
        return a * modpow(a, p - 1) % MOD;
    }
}

int main() {
    ll n, m;
    cin >> n >> m;
    //したから
    vector<ll> x(n);
    REP(i, n) { cin >> x[i]; }
    //左から
    vector<ll> y(m);
    REP(i, m) { cin >> y[i]; }
    ll x_sum = 0;
    ll y_sum = 0;
    for(int i = 0; i < n; i++) {
        for(int j = i + 1; j < n; j++) {
            ll x_sum += (x[j] - x[i]) % MOD;
        }
    }
    for(int k = 0; k < m; k++) {
        for(int l = k + 1; l < m; l++) {
            ll y_sum += (y[l] - y[k]) % MOD;
        }
    }
    area += x_sum * y_sum % MOD;
    cout << area % MOD << endl;
    return 0;
}