#include <bits/stdc++.h>
using namespace std;
long long abs(long long a) { return a > 0 ? a : -a; }
long long n, m, x[10005], y[10005], ans;
signed main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= n; i++) scanf("%lld", &x[i]);
  for (long long i = 1; i <= m; i++) scanf("%lld", &y[i]);
  for (long long i = 1; i <= n; i++) {
    for (long long j = i + 1; j <= n; j++) {
      for (long long k = 1; k <= m; k++) {
        for (long long l = k + 1; l <= m; l++) {
          ans += (abs(x[i] - x[j]) * abs(y[l] - y[k])) % 1000000007;
          ans %= 1000000007;
        }
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
