#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m;
long long x[1000100], y[1000100];
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 calc(long long *x, long long n) {
  long long sum = 0;
  for (long long i = 1; i <= n; i++) {
    long long y = ((i * (n - i)) % mod) * (x[i] - x[i - 1]) % mod;
    sum = (sum + y) % mod;
  }
  return sum;
}
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];
  }
  cout << (calc(x, n) * calc(y, n)) % mod << endl;
}
