#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  vector<long long> x, y;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    long long tmp;
    cin >> tmp;
    x.push_back(tmp);
  }
  for (long long i = 0; i < m; i++) {
    long long tmp;
    cin >> tmp;
    y.push_back(tmp);
  }
  long long l = 0;
  long long r = n - 1;
  long long u = 0;
  long long d = m - 1;
  long long ans = 0;
  while (l < r && u < d) {
    ans += ((x[r] - x[l]) * (y[d] - y[u]) * (r - l) * (d - u)) % 1000000007;
    ans = ans % 1000000007;
    l++;
    r--;
    u++;
    d--;
  }
  cout << ans << endl;
  return (0);
}
