#include <bits/stdc++.h>
using namespace std;
const int INF = 987654321;
const long long MOD = 1e9 + 7;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> x(n);
  vector<int> y(m);
  for (int i = (0); i < (n); ++i) {
    cin >> x[i];
  }
  for (int i = (0); i < (m); ++i) {
    cin >> y[i];
  }
  sort((x).begin(), (x).end());
  sort((y).begin(), (y).end());
  long long totalX = 0;
  long long totalY = 0;
  for (int i = (1); i < (n); ++i) {
    int dx = x[i] - x[i - 1];
    int cnt = i * (n - i);
    totalX += (long long)dx * cnt;
    totalX %= MOD;
  }
  for (int i = (1); i < (m); ++i) {
    int dy = y[i] - y[i - 1];
    int cnt = i * (m - i);
    totalY += (long long)dy * cnt;
    totalY %= MOD;
  }
  cout << totalX * totalY % MOD << '\n';
  return 0;
}
