#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, x[100001] = {}, y[100001] = {};
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  long long X = 0, Y = 0;
  for (int i = 0; i < n - 1; i++)
    X +=
        ((x[i + 1] - x[i]) * ((i + 1) * (n - i - 1)) % 1000000007) % 1000000007;
  for (int i = 0; i < m - 1; i++)
    Y +=
        ((y[i + 1] - y[i]) * ((i + 1) * (m - i - 1)) % 1000000007) % 1000000007;
  cout << (X * Y) % 1000000007 << endl;
  return 0;
}
