#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
const ll mod = 1000000007;
const ll INF = 1000000099;
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
signed main() {
  ll n, m, ans = 1, xsum = 0, ysum = 0;
  cin >> n >> m;
  vector<ll> x(n), y(m);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    if (i) {
      xsum += ((x[i] - x[i - 1]) * i % mod) * (n - i) % mod;
    }
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
    if (i) {
      ysum += ((y[i] - y[i - 1]) * i % mod) * (m - i) % mod;
    }
  }
  ans *= xsum;
  ans %= mod;
  ans *= ysum;
  ans %= mod;
  cout << ans << endl;
}
