#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 1e+14;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  long long x[100100], y[100100], a[100100], b[100100];
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  for (int i = 0; i < n - 1; i++) a[i] = x[i + 1] - x[i];
  for (int i = 0; i < m - 1; i++) b[i] = y[i + 1] - y[i];
  long long d[100100], h[100100];
  for (int i = 0; i < n - 1; i++) {
    d[i] = (i + 1) * (n - 1 - i);
    d[i] %= mod;
  }
  for (int i = 0; i < m - 1; i++) {
    h[i] = (i + 1) * (m - 1 - i);
    h[i] %= mod;
  }
  long long A = 0, B = 0;
  for (int i = 0; i < n - 1; i++) {
    A += a[i] * d[i];
    A %= mod;
  }
  for (int i = 0; i < m - 1; i++) {
    B += b[i] * h[i];
    B %= mod;
  }
  cout << (A * B) % mod << endl;
  return 0;
}
