#include <bits/stdc++.h>
const long long INF = INT_MAX / 2;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
using namespace std;
long long int ans = 0, sum = 0, n, k, cnt = 0, w, h;
string s;
vector<long long int> v;
vector<long long int> v1;
vector<pair<long long int, long long int> > vp;
vector<pair<long long int, long long int> > vp1;
vector<vector<long long int> > vv(50, vector<long long int>(50, INF));
vector<string> vs;
vector<char> vc;
set<long long int> st;
map<char, long long int> mp;
int main() {
  cin >> n >> k;
  v.resize(n);
  v1.resize(k);
  for (long long int i = (long long int)(0); i < (long long int)(n); i++)
    cin >> v[i];
  for (long long int i = (long long int)(0); i < (long long int)(k); i++)
    cin >> v1[i];
  for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
    for (long long int j = (long long int)(i); j < (long long int)(n); j++) {
      cnt += abs(v[i] - v[j]) % MOD;
      cnt %= MOD;
    }
  }
  for (long long int i = (long long int)(0); i < (long long int)(k); i++) {
    for (long long int j = (long long int)(i); j < (long long int)(k); j++) {
      sum += abs(v1[i] - v1[j]) % MOD;
      sum %= MOD;
    }
  }
  cout << sum * cnt % MOD << endl;
}
