#include <bits/stdc++.h>
using namespace std;
void gen_sosuu(int sosuu[]) {
  for (int i = 0; i < (int)(100010); i++) {
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  for (int i = (2); i < (int)(sqrt(100000) + 1); i++) {
    if (sosuu[i] == false) continue;
    for (int j = 2; i * j <= 100000; j++) {
      sosuu[i * j] = false;
    }
  }
}
long long int mod = 1000000000 + 7;
long long int n, m;
vector<long long int> x, y;
long long int x_l[100000];
long long int y_l[100000];
long long int sum = 0;
int main() {
  scanf("%lld %lld", &n, &m);
  long long int prev;
  for (int i = 0; i < (int)(n); i++) {
    long long int a;
    scanf("%lld", &a);
    if (i == 0) {
      prev = a;
      continue;
    }
    x.push_back(a - prev);
    prev = a;
  }
  for (int i = 0; i < (int)(m); i++) {
    long long int a;
    scanf("%lld", &a);
    if (i == 0) {
      prev = a;
      continue;
    }
    y.push_back(a - prev);
    prev = a;
  }
  for (int k = 0; k < (int)(n); k++) {
    if (k > n - k - 2) break;
    if (k == n - k - 2) {
      sum += (2 * (n - 1) * (k + 1) - (k + 1) * (k + 2) / 2 - n + 2) * (x[k]);
    } else {
      sum += (2 * (n - 1) * (k + 1) - (k + 1) * (k + 2) / 2 - n + 2) *
             (x[k] + x[n - k - 2]);
    }
    sum %= mod;
  }
  sum %= mod;
  long long int ysum = 0;
  for (int k = 0; k < (int)(m); k++) {
    if (k > m - k - 2) break;
    if (k == m - k - 2) {
      ysum += (2 * (m - 1) * (k + 1) - (k + 1) * (k + 2) / 2 - m + 2) * (y[k]);
    } else {
      ysum += (2 * (m - 1) * (k + 1) - (k + 1) * (k + 2) / 2 - m + 2) *
              (y[k] + y[m - k - 2]);
    }
    ysum %= mod;
  }
  ysum %= mod;
  printf("%lld\n", (sum * ysum) % mod);
}
