#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long dfs(deque<int> deq, long long val) {
  if (deq.size() < 2) {
    return val;
  }
  long long w = deq.back() - deq.front();
  val += w * (deq.size() - 1);
  val %= mod;
  deq.pop_front();
  deq.pop_back();
  return dfs(deq, val);
}
int main() {
  int n, m, tmp;
  cin >> n >> m;
  deque<int> x, y;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    x.push_back(tmp);
  }
  for (int i = 0; i < m; i++) {
    cin >> tmp;
    y.push_back(tmp);
  }
  long long w = x.back() - x.front();
  long long h = y.back() - y.front();
  long long a = dfs(x, 0);
  long long b = dfs(y, 0);
  long long ans = a * b % mod;
  cout << ans << endl;
  return 0;
}
