#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long sx;
long long sy;
long long mod = 1e9 + 7;
long long x[200000], y[200000];
int main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> x[i];
  }
  for (long long i = 1; i <= m; i++) {
    cin >> y[i];
  }
  for (long long i = 1; i <= n; i++) {
    sx += ((i - 1) * x[i] - (n - i) * x[i]) % mod;
  }
  for (long long i = 1; i <= m; i++) {
    sy += ((i - 1) * y[i] - (m - i) * y[i]) % mod;
  }
  cout << sx % mod * sy % mod << endl;
  return 0;
}
