#include <bits/stdc++.h>
using namespace std;
long long x[100001] = {};
long long y[100001] = {};
const long long mod = (int)1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> x[i];
  long long width = x[n - 1] - x[0];
  for (int i = 0; i < m; ++i) cin >> y[i];
  long long height = y[m - 1] - y[0];
  long long sum1 = 0, sum2 = 0;
  for (int i = 0; i < n - 1; ++i) {
    sum1 = (sum1 + ((x[i + 1] - x[i]) * ((i + 1) * (n - i - 1)) % mod) % mod) %
           mod;
  }
  for (int i = 0; i < m - 1; ++i) {
    sum2 = (sum2 + ((y[i + 1] - y[i]) * ((i + 1) * (m - i - 1)) % mod) % mod) %
           mod;
  }
  cout << (sum1 * sum2) % mod << endl;
  return 0;
}
