#include<bits/stdc++.h>
#define inf ((1<<30)-1)
#define linf ((1<<62)ll-1)
#define LL long long
#define F(i,a,b,c) for(register int i=(a);(b);i=(c))
#define Fu(i,a,b) for(register int i=(a);i<=(b);++i)
#define Fd(i,a,b) for(register int i=(a);i>=(b);--i)
#define Fn(i,a) for(register int i=las[(a)];i;i=nex[i])
#define COND(c) (isprint(c))
int Fl,Pn,SI=100;char mch=' ',ch,Bf[21];
void chin(char&c){while(!COND(c=getchar()));}
template<typename t>void in(t&a){a=0;ch=getchar();Fl=1;while(((ch<'0')||(ch>'9'))&&ch!=EOF)Fl=(ch=='-')?-Fl:Fl,ch=getchar();while((ch>='0')&&(ch<='9'))a=a*10+ch-'0',ch=getchar();a*=Fl;}template<typename t>void out(t a){if(a<0)putchar('-'),a=-a;if(a==0)putchar('0');while(a)Bf[++Pn]=a%10+'0',a/=10;while(Pn)putchar(Bf[Pn]),--Pn;putchar(mch);}
template<typename t,typename ...ARGS>void in(t&a,ARGS&...args){in(a);in(args...);}
template<typename t,typename ...ARGS>void out(t a,ARGS... args){out(a);out(args...);}
using namespace std;
int n,m,a[100001],b[100001];LL sum;
#define mod 1000000007
int main()
{
	in(n,m);
	Fu(i,1,n)in(a[i]);
	Fu(i,1,m)in(b[i]);
	Fu(i,1,n)
	Fu(j,i+1,n)
	Fu(k,1,m)
	Fu(j,k+1,m)
	(sum+=((LL)((a[j]-a[i])%mod)*(b[l]-b[k])%mod)%mod)%=mod;
	cout<<sum<<endl;
	return 0;
}
//BY Segment_Tree_Juruo (2020严誉沣)
