#include <stdio.h>
typedef long long ll;

int main(void) {
  ll i, j, n, m, sx = 0, sy = 0, x, y;
  scanf("%lld%lld", &n, &m);
  for(i = 0; i < n; ++i) {
    scanf("%lld", &x);
    sx -= (n - 2 * i - 1) * x;
    sx %= 1000000007;
  }
  sx = (sx + 2000000014) % 1000000007;
  for(i = 0; i < m; ++i) {
    scanf("%lld", &y);
    sy -= (m - 2 * i - 1) * y;
    sy %= 1000000007;
  }
  sy = (sy + 2000000014) % 1000000007;
  printf("%lld", (sx * sy) % 1000000007);
  return 0;
}