#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const long long int INF = 4e18;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(m), x(n - 1), y(m - 1);
  for (int i = (0); i < (n); i++) cin >> a[i];
  for (int i = (0); i < (m); i++) cin >> b[i];
  for (int i = (0); i < (n - 1); i++) x[i] = a[i + 1] - a[i];
  for (int i = (0); i < (m - 1); i++) y[i] = b[i + 1] - b[i];
  long long int xsum = 0, ysum = 0;
  for (int i = (0); i < (n - 1); i++) {
    xsum += (1LL * (i + 1) * (n - 1 - i) * x[i]) % mod;
  }
  for (int i = (0); i < (m - 1); i++) {
    ysum += (1LL * (i + 1) * (m - 1 - i) * y[i]) % mod;
  }
  printf("%d", (1LL * xsum * ysum) % mod);
  return 0;
}
