#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> x(n);
  vector<long long> y(m);
  for (int i = 0; i < (n); i++) {
    cin >> x[i];
    x[i] += 1e9;
  }
  for (int i = 0; i < (m); i++) {
    cin >> y[i];
    y[i] += 1e9;
  }
  long long ans = 0;
  long long zi = 0, zj = 0, zk = 0, zl = 0;
  for (int i = 0; i < (n - 1); i++) {
    zi += x[i + 1] % mod * (i + 1) % mod;
    zi %= mod;
    zj += x[i] % mod * (n - 1 - i) % mod;
    zj %= mod;
  }
  for (int i = 0; i < (m - 1); i++) {
    zk += y[i + 1] % mod * (i + 1) % mod;
    zk %= mod;
    zl += y[i] % mod * (m - 1 - i) % mod;
    zl %= mod;
  }
  ans = (zi - zj) % mod;
  ans *= (zk - zl) % mod;
  ans %= mod;
  cout << ans % mod << endl;
  return 0;
}
