#include <bits/stdc++.h>
using namespace std;
double inf = numeric_limits<double>::infinity();
int main() {
  long a = 0, b = 0, c = 0, d = 0;
  long MOD = 1e9 + 7;
  long n, m;
  cin >> n >> m;
  long x, y;
  for (long i = 0; i < n; i++) {
    cin >> x;
    a += i * x;
    a %= MOD;
    b += (n - 1 - i) * x;
    b %= MOD;
  }
  a = a - b;
  for (long i = 0; i < m; i++) {
    cin >> y;
    c += i * y;
    c %= MOD;
    d += (m - 1 - i) * y;
    d %= MOD;
  }
  c = c - d;
  cout << a * c % MOD << endl;
}
