#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
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];
  vector<unsigned long long> dx(n - 1), dy(m - 1);
  for (int i = 0; i < n - 1; i++) dx[i] = (x[i + 1] - x[i]) % MOD;
  for (int i = 0; i < m - 1; i++) dy[i] = (y[i + 1] - y[i]) % MOD;
  vector<unsigned long long> cnt_x(n - 1), cnt_y(m - 1);
  for (int i = 0; i < n - 1; i++) cnt_x[i] = ((i + 1) * (n - i - 1)) % MOD;
  for (int i = 0; i < m - 1; i++) cnt_y[i] = ((i + 1) * (m - i - 1)) % MOD;
  unsigned long long size_x = 0, size_y = 0;
  for (int i = 0; i < n - 1; i++) {
    size_x += (dx[i] * cnt_x[i]) % MOD;
    size_x %= MOD;
  }
  for (int i = 0; i < m - 1; i++) {
    size_y += (dy[i] * cnt_y[i]) % MOD;
    size_y %= MOD;
  }
  cout << (size_x * size_y) % MOD << endl;
}
