#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long x[100000];
long long y[100000];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  long long xi = 0;
  long long xj = 0;
  long long yk = 0;
  long long yl = 0;
  for (int j = n - 1; j > 0; j--) {
    xj = (xj + ((x[j] * j) % MOD)) % MOD;
  }
  for (int i = 0; i < n - 1; i++) {
    xi = (xi + ((x[i] * (n - 1 - i)) % MOD)) % MOD;
  }
  for (int l = m - 1; l > 0; l--) {
    yl = (yl + ((y[l] * l) % MOD)) % MOD;
  }
  for (int k = 0; k < m - 1; k++) {
    yk = (yk + ((y[k] * (m - 1 - k)) % MOD)) % MOD;
  }
  long long ans = (((xj - xi + MOD) % MOD) * ((yl - yk + MOD) % MOD)) % MOD;
  cout << ans << endl;
  return 0;
}
