#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int x[100005], y[100005];
int n, m;
long long ax, ay, ans;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 1; i <= m; i++) cin >> y[i];
  for (int i = 1; i <= n / 2; i++)
    ax += ((n - 1 - 2 * (i - 1)) * (x[n + 1 - i] - x[i])) % mod, ax %= mod;
  for (int i = 1; i <= m / 2; i++)
    ay += ((m - 1 - 2 * (i - 1)) * (y[m + 1 - i] - y[i])) % mod, ay %= mod;
  ans = (long long)ax * (long long)ay % mod;
  cout << ans;
}
