#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"mod=10**9+7\n"
"n,m=map(int,input().split())\n"
"x=list(map(int,input().split()))\n"
"y=list(map(int,input().split()))\n"
"xl=0\n"
"xt=0\n"
"yl=0\n"
"yt=0\n"
"for i in range(n-1):\n"
"  if i==0:\n"
"    for j in range(1,n):\n"
"      xt+=x[j]-x[i]\n"
"    xl=xt\n"
"  else:\n"
"    xt-=(x[i]-x[i-1])*(n-i)\n"
"    xl=(xl+xt)%mod\n"
"for i in range(m-1):\n"
"  if i==0:\n"
"    for j in range(1,m):\n"
"      yt+=y[j]-y[i]\n"
"    yl=yt\n"
"  else:\n"
"    yt-=(y[i]-y[i-1])*(m-i)\n"
"    yl=(yl+yt)%mod\n"
"print(xl*yl%mod)\n"
"\"";
  system(s);
  return 0;
}            