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