#include <bits/stdc++.h>
using namespace std;
inline void solve() {
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n);
  vector<long long> y(m);
  long long h = 0;
  long long w = 0;
  for (long long i = 0; i < n; i++) cin >> x[i];
  for (long long i = 0; i < m; i++) cin >> y[i];
  for (long long i = 0; i < n - 1; i++) {
    h += (x[i + 1] - x[i]) * (i + 1) * (n - i - 1);
    h %= 1000000007;
  }
  for (long long i = 0; i < m - 1; i++) {
    w += (h * (y[i + 1] - y[i]) * (i + 1) * (m - i - 1)) % 1000000007;
    w %= 1000000007;
  }
  cout << w << endl;
}
signed main() {
  long long n = 1;
  while (n--) solve();
  return 0;
}
