#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n, m;
    cin >> n >> m;
    VLL x(n), y(m);
    REP(i,0,n) cin >> x[i];
    REP(i,0,m) cin >> y[i];
    sort(all(x));
    sort(all(y));
    VLL dx(n-1), dy(m-1);
    REP(i,0,n-1) dx[i] = x[i+1] - x[i];
    REP(i,0,m-1) dy[i] = y[i+1] - y[i];
    LL sumx = 0;
    --n;
    --m;
    //REP(i,0,n+1) cerr << "x[" << i << "]=" << x[i] << endl;
    //REP(i,0,n) cerr << "dx[" << i << "]=" << dx[i] << endl;
    //REP(i,0,m) cerr << "dy[" << i << "]=" << dy[i] << endl;
    REP(i,0,n) sumx = (sumx + dx[i] * (n - i) * (i + 1)) % 1000000007;
    LL sum = 0;
    REP(i,0,m) sum = (sum + sumx * dy[i] * (m - i) * (i + 1)) % 1000000007;
    cout << sum << endl;
}

int main() {
    solve();
    
    return 0;
}