#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e+9 + 7;
const int MAX = 1e+5;
int n, m;
int x[MAX + 5], y[MAX + 5];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int j = 1; j <= m; j++) cin >> y[j];
  long long sum_x, sum_y;
  sum_x = sum_y = 0;
  for (int k = 1; k <= n; k++) {
    sum_x += ((k - 1) * x[k] - (n - k) * x[k]) % MOD;
    sum_x %= MOD;
  }
  for (int k = 1; k <= m; k++) {
    sum_y += ((k - 1) * y[k] - (m - k) * y[k]) % MOD;
    sum_y %= MOD;
  }
  cout << (sum_x * sum_y) % MOD << endl;
  return 0;
}
