#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> x(N), y(N);
  long long sum_x = 0, sum_y = 0;
  for (int i = 0; i < N; i++) {
    cin >> x[i];
    sum_x += x[i];
  }
  for (int i = 0; i < M; i++) {
    cin >> y[i];
    sum_y += y[i];
  }
  long long ans1 = 0;
  for (int i = 0; i < N - 1; i++) {
    sum_x -= x[i];
    long long tmp = sum_x - (N - 1 - i) * x[i];
    while (tmp <= 0) tmp += mod;
    ans1 += tmp;
    ans1 %= mod;
  }
  long long ans2 = 0;
  for (int i = 0; i < M - 1; i++) {
    sum_y -= y[i];
    long long tmp = sum_y - (M - 1 - i) * y[i];
    while (tmp <= 0) tmp += mod;
    ans2 += tmp;
    ans2 %= mod;
  }
  cout << (ans1 * ans2) % mod << endl;
  return 0;
}
