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