#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int n, m;
  cin >> n >> m;
  vector<long long int> x(n), y(m);
  for (auto &z : x) cin >> z;
  for (auto &z : y) cin >> z;
  vector<long long int> multimex(n - 1);
  for (int i = 0; i < n - 1; i++) multimex[i] = (i + 1) * (n - i - 1);
  long long int areax = 0;
  for (int i = 0; i < n - 1; i++) {
    areax = (areax + ((x[i + 1] - x[i]) * multimex[i]) % mod) % mod;
  }
  vector<long long int> multimey(n);
  for (int i = 0; i < m - 1; i++) multimey[i] = (i + 1) * (m - i - 1);
  long long int areay = 0;
  for (int i = 0; i < m - 1; i++) {
    areay = (areay + ((y[i + 1] - y[i]) * multimey[i]) % mod) % mod;
  }
  long long int ans = (areax * areay) % mod;
  cout << ans << endl;
  return 0;
}
