#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(void) {
  ll n, m;
  cin >> n >> m;
  vector<ll> x(n);
  for (auto& it : x) cin >> it;
  vector<ll> y(m);
  for (auto& it : y) cin >> it;
  ll X = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      X += abs(x[i] - x[j]);
      X %= 1000000007;
    }
  }
  ll Y = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < i; j++) {
      Y += abs(y[i] - y[j]);
      Y %= 1000000007;
    }
  }
  cout << X * Y % 1000000007 << endl;
  return 0;
}
