#include <stdio.h>

int main(void)
{
  long long int n,m;
  scanf("%lld %lld",&n,&m);
  long long int i,j,xtotal=0,ytotal=0;
  long long int x[n],y[m];
  for (i=0;i<n;i++) {
    scanf("%lld",&x[i]);
    xtotal +=( (2i-n+2)*x[i] );
  }
  for (i=0;i<m;i++) {
    scanf("%lld",&y[i]);
    ytotal +=( (2i-m+2)*y[i] );
  }

  xtotal = xtotal*ytotal;
  printf("%lld\n",xtotal%(1000000000+7));
}
