#include <bits/stdc++.h>
using namespace std;
template <typename T>
void view(T e) {
  std::cout << e << std::endl;
}
template <typename T>
void view(const std::vector<T>& v) {
  for (const auto& e : v) {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T> >& vv) {
  for (const auto& v : vv) {
    view(v);
  }
}
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int MOD = 1000000007;
const int INF = 1e9;
const int mod = 1000000007;
const int inf = 1e9;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int ddx[8] = {1, 1, 1, -1, -1, -1, 0, 0};
int ddy[8] = {0, 1, -1, 0, 1, -1, 1, -1};
const long long MAX = 200000;
long long inv[MAX], fac[MAX], finv[MAX];
void settable() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long choose(long long n, long long k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long modpow(long long n, long long k) {
  long long rtn = 1;
  while (k > 0) {
    if (k & 1) rtn = rtn * n % MOD;
    n = n * n % MOD;
    k = k >> 1;
  }
  return rtn;
}
int main() {
  settable();
  int n, m;
  cin >> n >> m;
  vector<long long> x(n), y(m);
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  long long sumx, sumy;
  sumx = sumy = 0;
  for (int i = 0; i < n; i++) {
    sumx += i * x[i] - (n - 1 - i) * x[i];
    sumx %= MOD;
  }
  for (int i = 0; i < m; i++) {
    sumy += i * y[i] - (m - 1 - i) * y[i];
  }
  long long ans = sumx * sumy % MOD;
  cout << ans << endl;
}
