#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m;
long long x[100010], y[100010];
long long powmod(long long n, long long p, long long m) {
  if (p == 0) return 1;
  if (p % 2 == 0) {
    long long t = powmod(n, p / 2, m);
    return t * t % m;
  }
  return n * powmod(n, p - 1, m);
}
long long ans;
long long memo[300010];
long long memo2[300030];
signed main() {
  cin >> n >> m;
  for (long long i = 0; i < (n); i++) {
    cin >> x[i];
  }
  for (long long i = 0; i < (m); i++) {
    cin >> y[i];
  }
  long long tmp = 0;
  long long tmp2 = 0;
  for (long long i = 0; i < n - 1; i++) {
    for (long long j = i + 1; j < n; j++) {
      memo[tmp++] = (x[j] - x[i]) % mod;
    }
  }
  for (long long k = 0; k < m - 1; k++) {
    for (long long l = k + 1; l < m; l++) {
      memo2[tmp2++] = (y[l] - y[k]) % mod;
    }
  }
  for (long long i = 0; i < tmp; i++) {
    for (long long j = 0; j < tmp2; j++) {
      ans += (memo[i] * memo2[j]) % mod;
    }
  }
  cout << ans % mod << endl;
}
