// https://atcoder.jp/contests/abc058/tasks/arc071_b
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
const int MOD = 1000000007;
namespace mp = boost::multiprecision;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m, t;
    cin >> n >> m;
    vector<int> vx(n), vy(m);
    REP(i, n) {
        cin >> t;
        vx[i] = t;
    }
    REP(i, m) {
        cin >> t;
        vy[i] = t;
    }
    ll x = 0, y = 0;
    REP(i, n) FOR(j, i + 1, n) {
        x += abs(vx[i] - vx[j]);
        x %= MOD;
    }
    REP(i, m) FOR(j, i + 1, m) {
        y += abs(vy[i] - vy[j]);
        y %= MOD;
    }
    cout << (x * y) % MOD << endl;
    return 0;
}
