#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long n, m, x[100000], y[100000], r[100000], c[100000], ans = 0;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  c[0] = n - 1;
  c[n - 2] = n - 1;
  r[0] = m - 1;
  r[m - 2] = m - 1;
  for (int i = 1; i < n / 2; i++) {
    c[i] = (c[i - 1] + (n - 1 - 2 * i)) % MOD;
    c[n - 2 - i] = c[i];
  }
  for (int i = 1; i < m / 2; i++) {
    r[i] = (r[i - 1] + (m - 1 - 2 * i)) % MOD;
    r[m - 2 - i] = r[i];
  }
  long long l = 0;
  for (int i = 0; i < n - 1; i++) {
    l += ((x[i + 1] - x[i]) * c[i]) % MOD;
    l %= MOD;
  }
  for (int i = 0; i < m - 1; i++) {
    ans += (l * (y[i + 1] - y[i]) * r[i]) % MOD;
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
