#include <bits/stdc++.h>
#include <iomanip>

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef long double LD;
typedef pair<LD, LD> PLDLD;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()

const double eps=1e-5;
const int INF=1e9;


class Mod
{
    private:
        static const long long MODULO = 1e9+7;
        long long value;

        const void Normalize()
        {
            value=value<0?(value%MODULO+MODULO):(value%MODULO);
        }

    public:
        Mod():value(0){}
        Mod(const long long &val)
        {
            value=val;
            Normalize();
        }
        
        explicit operator long long () const
        {
            return value;
        }

        const Mod operator -() const
        {
            return Mod(MODULO - value);
        }
        const Mod operator +(const Mod &rhs) const
        {
            return Mod(value + rhs.value);
        }
        const Mod operator -(const Mod &rhs) const
        {
            return Mod(value + (-rhs).value);
        }
        const Mod operator *(const Mod &rhs) const
        {
            return Mod(value * rhs.value);
        }
        Mod &operator +=(const Mod &rhs)
        {
            return *this = *this + rhs;
        }
        Mod &operator -=(const Mod &rhs)
        {
            return *this = *this - rhs;
        }
        Mod &operator *=(const Mod &rhs)
        {
            return *this = *this * rhs;
        }


        Mod pow(long long p) const;

        Mod inv() const
        {
            return pow(MODULO-2);
        }

        const Mod operator /(const Mod &rhs) const
        {
            return *this * rhs.inv();
        }
        Mod &operator /=(const Mod &rhs)
        {
            return *this = *this / rhs;
        }
};

Mod Mod::pow(long long p) const
{
    Mod tmp=1, mult=*this;
    while(p)
    {
        if((p&1)>0) tmp*=mult;
        p>>=1;
        mult*=mult;
    }
    return tmp;
}

namespace std
{
    ostream& operator<<(ostream& os, const Mod mod)
    {
        os<<(long long)mod;
        return os;
    }
};
class Factorial
{
    private:
        vector<Mod> ary;
    public:
        explicit Factorial(const size_t size):ary(vector<Mod>(size))
        {
            ary[0]=1;
            for(size_t i=1;i<size;i++)
                ary[i]=ary[i-1]*i;
        }

        size_t size() const {   return ary.size();  }

        Mod operator[] (const int id) const
        {
            return ary[id];
        }
};
class FactorialInv
{
    private:
        vector<Mod> ary;
    public:
        explicit FactorialInv(const Factorial &fact):ary(vector<Mod>(fact.size()))
        {
            for(size_t i=0;i<ary.size();i++)
                ary[i]=fact[i].inv();
        }

        //FactorialInv& operator=(FactorialInv&&)=default;

        Mod operator[] (const int id) const
        {
            return ary[id];
        }
};

class Combination
{
    private:
        const Factorial *fact;
        const FactorialInv *fact_inv;
    public:
        Combination(const Factorial &fact_, const FactorialInv &fact_inv_):fact(&fact_),fact_inv(&fact_inv_)
        {}

        Mod operator()(const int n, const int m) const
        {
            return (*fact)[n] * (*fact_inv)[m] * (*fact_inv)[n-m];
        }
};

int main()
{
	/*Factorial fact(210000);
	FactorialInv facti(fact);
	Combination comb(fact, facti);*/

	int n,m;
	cin>>n>>m;
	vector<LL> x(n),y(m);
	REP(i,n)
		cin>>x[i];
	REP(i,m)
		cin>>y[i];
	
	//sort(ALL(x));
	//sort(ALL(y));

	vector<Mod> cx(n-1);
	vector<Mod> cy(m-1);

	LL ad=0,p=n-1;
	REP(i,(n)/2)
	{
		ad+=p;
		p-=2;
		cx[i]=ad;
	}
	FOR(i,n/2, n-1)
	{
		cx[i]=cx[n-2-i];
	}
	ad=0;
	p=m-1;
	REP(i,(m)/2)
	{
		ad+=p;
		p-=2;
		cy[i]=ad;
	}
	FOR(i,m/2, m-1)
	{
		cy[i]=cy[m-2-i];
	}


	Mod sumx=0,sumy=0;
	REP(i,n-1)
	{
		sumx+=cx[i]*(x[i+1]-x[i]);
	}

	REP(j,m-1)
	{
		sumy+=cy[j]*(y[j+1]-y[j]);
	}

	cout<<sumx*sumy<<endl;
}



Measured memory_bytes: 3328