#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int32_t main() {
  long long n, m;
  cin >> n >> m;
  long long x[n + 1];
  long long y[m + 1];
  for (long long i = 1; i <= n; i++) cin >> x[i];
  for (long long j = 1; j <= m; j++) cin >> y[j];
  long long xs = 0, ys = 0;
  for (long long i = 1; i <= n; i++) {
    xs += (((i - 1) * x[i]) % mod - ((n - i) * x[i]) % mod + mod) % mod;
  }
  for (long long i = 1; i <= m; i++) {
    ys += (((i - 1) * y[i]) % mod - ((m - i) * y[i]) % mod + mod) % mod;
  }
  cout << (ys * xs) % mod;
}
