#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 1e16;
const long long MAX_N = 100010;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n);
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
  }
  vector<long long> y(m);
  for (long long i = 0; i < m; i++) {
    cin >> y[i];
  }
  long long Ax = 0;
  for (long long i = 0; i < n; i++) {
    Ax += (2 * i - (n - 1)) * x[i];
    Ax %= mod;
  }
  long long Ay = 0;
  for (long long i = 0; i < n; i++) {
    Ay += (2 * i - (n - 1)) * y[i];
    Ay %= mod;
  }
  long long ans = (Ax * Ay) % mod;
  cout << ans << endl;
  return 0;
}
