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