#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m;
long long x[100010], y[100010];
long long powmod(long long n, long long p, long long m) {
  if (p == 0) return 1;
  if (p % 2 == 0) {
    long long t = powmod(n, p / 2, m);
    return t * t % m;
  }
  return n * powmod(n, p - 1, m);
}
long long ans;
signed main() {
  cin >> n >> m;
  for (long long i = 0; i < (n); i++) {
    cin >> x[i];
  }
  for (long long i = 0; i < (m); i++) {
    cin >> y[i];
  }
  for (long long i = 0; i < n - 1; i++) {
    for (long long j = i + 1; j < n; j++) {
      for (long long k = 0; k < m - 1; k++) {
        for (long long l = k + 1; l < m; l++) {
          ans += (((x[j] - x[i]) % mod) * ((y[l] - y[k])) % mod) % mod;
        }
      }
    }
  }
  cout << ans % mod << endl;
}
