#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10010;
const long long MOD = 1000000007;
long long ans, sy, sx;
int x[MAXN], y[MAXN], n, m;
int main() {
  int i;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &x[i]);
  for (i = 1; i <= m; i++) scanf("%d", &y[i]);
  for (i = 1; i <= m; i++) {
    sy = (sy + (long long)y[i] * (i - 1) % MOD) % MOD;
    sy = (sy - (long long)y[i] * (m - i) % MOD + MOD) % MOD;
  }
  for (i = 1; i <= n; i++) {
    sx = (sx + (long long)x[i] * (i - 1) % MOD) % MOD;
    sx = (sx - (long long)x[i] * (n - i) % MOD + MOD) % MOD;
  }
  printf("%lld", sx * sy % MOD);
  return 0;
}
