#include <bits/stdc++.h>
using namespace std;
long long p = 1000 * 1000 * 1000 + 7;
long long a(long long n, long long i) {
  return i + 1 + (i + 1) * (n - i - 2) % p;
}
int main() {
  long long n, m;
  long long *x, *y;
  cin >> n >> m;
  x = new long long[n];
  y = new long long[m];
  for (int i = (0); i < (n); ++i) {
    cin >> x[i];
  }
  for (int i = (0); i < (m); ++i) {
    cin >> y[i];
  }
  long long sum_x = 0, sum = 0;
  for (int i = (0); i < (n - 1); ++i) {
    sum_x += a(n, i) * (x[i + 1] - x[i]) % p;
  }
  for (int j = (0); j < (m - 1); ++j) {
    sum += (sum_x * a(m, j)) % p * (y[j + 1] - y[j]) % p;
  }
  cout << sum % p << endl;
  return 0;
}
