#include <bits/stdc++.h>
using namespace std;
long long n, m, x[100008], y[100008];
long long mod = 1e9 + 7;
int main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> x[i];
  }
  for (long long j = 1; j <= m; j++) {
    cin >> y[j];
  }
  long long pseudoh = 0;
  long long pseudow = 0;
  for (long long i = 1; i <= n - 1; i++) {
    pseudoh += (i * (n - i) % mod) * (x[i + 1] - x[i]) % mod;
  }
  for (long long j = 1; j <= m - 1; j++) {
    pseudow += (j * (m - j) % mod) * (y[j + 1] - y[j]) % mod;
  }
  cout << pseudoh * pseudow % mod;
  return 0;
}
