#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1e9;
const int mod = 1000000007;
const int inf = 1e9;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int ddx[8] = {1, 1, 1, -1, -1, -1, 0, 0};
int ddy[8] = {0, 1, -1, 0, 1, -1, 1, -1};
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> x(n), y(m);
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  long long sumx, sumy;
  sumx = sumy = 0;
  cout << endl;
  for (int i = 0; i < n; i++) {
    sumx += i * x[i] - (n - 1 - i) * x[i];
  }
  for (int i = 0; i < m; i++) {
    sumy += i * y[i] - (m - 1 - i) * y[i];
  }
  long long ans = sumx * sumy % MOD;
  cout << ans << endl;
}
