#include <bits/stdc++.h>
const double pi = 4 * atan(1);
using namespace std;
const long long MOD = 1000000007;
const int MAXN = 200005;
long long x[MAXN];
long long y[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (long long i = (1); (i) < (n + 1); ++i) {
    cin >> x[i];
  }
  for (long long i = (1); (i) < (m + 1); ++i) {
    cin >> y[i];
  }
  n--;
  m--;
  long long s1 = 0;
  for (int i = 1; i <= n; i++) {
    s1 += (((i * (n - i + 1)) % MOD) * (x[i + 1] - x[i])) % MOD;
    s1 %= MOD;
  }
  long long s2 = 0;
  for (int i = 1; i <= m; i++) {
    s2 += (((i * (m - i + 1)) % MOD) * (y[i + 1] - y[i])) % MOD;
    s2 %= MOD;
  }
  cout << ((s1 * s2) % MOD) << "\n";
}
