#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main(int argc, char *argv[]) {
  int n, m;
  scanf("%d %d", &n, &m);
  long long x[n];
  long long y[m];
  for (int i = 0; i < n; ++i) {
    scanf("%I64d", &x[i]);
  }
  for (int i = 0; i < m; ++i) {
    scanf("%I64d", &y[i]);
  }
  long long foo = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      foo = (foo + abs(x[i] - x[j])) % MOD;
    }
  }
  long long bar = 0;
  for (int i = 0; i < m; ++i) {
    for (int j = i + 1; j < m; ++j) {
      bar = (bar + abs(y[i] - y[j])) % MOD;
    }
  }
  long long ans = (foo * bar) % MOD;
  cout << ans << endl;
  return 0;
}
