#include <bits/stdc++.h>
using namespace std;
int M, N;
long long exp_mod(int a, int b, int p) {
  long long res = 1;
  while (b != 0) {
    if (b & 1) res = (res * a) % p;
    a = a * a % p;
    b >>= 1;
  }
  return res;
}
int C(long long a, long long b, long long p) {
  if (a < b) return 0;
  if (a == b) return 1;
  if (b > a - b) b = a - b;
  long long ans = 1, ca = 1, cb = 1;
  for (long long i = 0; i < b; i++) {
    ca *= (a - i) % p;
    cb *= (b - i) % p;
  }
  ans = (ca * exp_mod(cb, p - 2, p));
  return ans;
}
long long Lucas(int n, int m, int p) {
  long long ans = 1;
  while (n && m && ans) {
    ans = (ans * C(n % p, m % p, p)) % p;
    n /= p;
    m /= p;
  }
  return ans;
}
long long x[100010];
long long y[100010];
void run() {
  int n, m;
  while (cin >> n >> m) {
    long long p = 1000000007;
    for (int i = 1; i <= n; ++i) cin >> x[i];
    for (int i = 1; i <= m; ++i) cin >> y[i];
    long long x_sum = 0;
    long long y_sum = 0;
    for (int i = 1; i <= n; ++i) {
      x_sum += ((i - 1) * x[i] - (n - i) * x[i]);
      x_sum %= p;
    }
    for (int i = 1; i <= m; ++i) {
      y_sum += y[i] * (2 * i - 1 - n) % p;
      y_sum %= p;
    }
    cout << y_sum * x_sum % p << endl;
  }
}
int main(int argc, char *argv[]) { run(); }
