#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 27;
const int MOD = (int)1e9 + 7;
int main(void) {
  int n, m;
  long long x[100010];
  long long y[100010];
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  long long sum_x = 0;
  long long sum_y = 0;
  for (int i = 0; i < n; i++) {
    sum_x += (2 * (i + 1) - n - 1) * x[i];
    sum_x %= MOD;
  }
  for (int i = 0; i < m; i++) {
    sum_y += (2 * (i + 1) - m - 1) * y[i];
    sum_y %= MOD;
  }
  long long ans = (sum_x * sum_y) % MOD;
  cout << ans << endl;
  return 0;
}
