#include <iostream>
#include <vector>

typedef long long ll;

int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<ll> vx(n);
  std::vector<ll> vy(m);
  ll mod = 1000000007;

  ll x_sum = 0;
  for (int i = 0; i < n; i++) {
    std::cin >> vx[i];
    x_sum += (i*vx[i] - (n-i-1)*vx[i]);
    x_sum = x_sum % mod;
  }
  ll y_sum = 0;
  for (int i = 0; i < m; i++) {
    std::cin >> vy[i];
    y_sum += (i*vy[i] - (m-i-1)*vy[i]);
    y_sum = y_sum % mod;
  }

  std::cout << x_sum * y_sum % mod;

  return 0;
}