#include <bits/stdc++.h>
using namespace std;
long long INF = 1e18;
long long MOD = 1e9 + 7;
int main() {
  int m, n;
  cin >> m >> n;
  long long temp;
  long long sumX = 0;
  for (int i = 1; i <= m; ++i) {
    cin >> temp;
    sumX += (2 * i - m - 1) * temp % MOD;
  }
  long long sumY = 0;
  for (int j = 1; j <= n; ++j) {
    cin >> temp;
    sumY += (2 * j - n - 1) * temp % MOD;
  }
  long long res = sumX * sumY % MOD;
  cout << res << endl;
  return 0;
}
