#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m;
long long x[100001];
long long y[100001];
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 = 0;
  for (long long k = 1; k <= n; k++) {
    sum_x =
        (sum_x + (((k - 1) * x[k] % mod) - ((n - k) * x[k] % mod)) % mod) % mod;
  }
  long long sum_y = 0;
  for (long long k = 1; k <= m; k++) {
    sum_y =
        (sum_y + (((k - 1) * y[k] % mod) - ((m - k) * y[k] % mod)) % mod) % mod;
  }
  cout << (sum_x % mod) * (sum_y % mod) % mod << endl;
}
