#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
typedef long long ll;
#define MODSIZE 1000000007

int main(){
  int n,m;
  int i,j,k;
  ll x[100006];
  ll y[100006];
  ll a,b;
  ll ans = 0;

  scanf("%d %d", &n, &m);

  for(i = 1;i <= n;i++) scanf("%lld", &x[i]);
  for(i = 1;i <= m;i++) scanf("%lld", &y[i]);

  a = 0; b = 0;
  for(k = 1;k <= n;k++){
    a = (a + ((2*k - n - 1)*x[k]) % MODSIZE) % MODSIZE;
  }

  for(k = 1;k <= m;k++){
    b = (b + ((2*k - m - 1)*y[k]) % MODSIZE) % MODSIZE;
  }

  printf("%lld\n", a*b % MODSIZE);



  return 0;
}
