#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int mod = 1000000007;
int main(void) {
  int N, M;
  cin >> N >> M;
  ll X[N];
  ll Y[N];
  for (int i = 0; i < N; i++) cin >> X[i];
  for (int i = 0; i < M; i++) cin >> Y[i];
  ll keisuu = -N + 1;
  ll acc_X = 0;
  for (int i = 0; i < N; i++) {
    acc_X = (acc_X + keisuu * X[i]) % mod;
    keisuu += 2;
  }
  keisuu = -M + 1;
  ll acc_Y = 0;
  for (int i = 0; i < M; i++) {
    acc_Y = (acc_Y + keisuu * Y[i]) % mod;
    keisuu += 2;
  }
  ll ans = (acc_X * acc_Y) % mod;
  if (ans < 0) ans += mod;
  cout << ans << endl;
  return 0;
}
