#include <bits/stdc++.h>
using namespace std;
long long x[100000], y[100000];
signed main() {
  long long n, m, ans = 0, ans2 = 0;
  cin >> n >> m;
  for (long long i = 0; i < (n); i++) {
    cin >> x[i];
  }
  for (long long i = 0; i < (m); i++) {
    cin >> y[i];
  }
  long long a = n - 1, b = n - 1;
  for (long long i = 1; i < n; i++) {
    b -= 2;
    ans += a * (x[i] - x[i - 1]) % 1000000007;
    a += b;
  }
  a = m - 1, b = m - 1;
  for (long long i = 1; i < m; i++) {
    b -= 2;
    ans2 += a * (y[i] - y[i - 1]) % 1000000007;
    a += b;
  }
  cout << ans * ans2 % 1000000007 << endl;
  return 0;
}
