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