#include <bits/stdc++.h>
using namespace std;
static const int64_t mod = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int64_t> x(N);
  for (int i = 0; i < N; i++) cin >> x.at(i);
  vector<int64_t> y(M);
  for (int i = 0; i < M; i++) cin >> y.at(i);
  int64_t X = 0;
  for (int i = 0; i < N; i++) {
    int64_t k = (mod + 2 * i - N + 1) % mod;
    k = (k * x.at(i)) % mod;
    X = (X + k) % mod;
  }
  int64_t Y = 0;
  for (int i = 0; i < M; i++) {
    int64_t k = (mod + 2 * i - M + 1) % mod;
    k = (k * y.at(i)) % mod;
    Y = (Y + k) % mod;
  }
  int64_t ans = (X * Y) % mod;
  cout << ans << endl;
  return 0;
}
