#include <bits/stdc++.h>
using namespace::std;

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef array<int, 3> tri;
typedef long double ld;

template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;}
template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;}




const int MOD = 1E9 + 7;
void _main() {
        int n, m; cin >> n >> m;
        vector<int> x(n), y(m); cin >> x >> y;

        auto solve = [](vector<int> a) {
                ll ans = 0, pre = 0;
                int n = sz(a);
                for (int i = 0; i < n; i++) {
                        ans += (ll) i * a[i] - (ll)(n - i - 1) * a[i];
                        ans += MOD;
                        ans %= MOD;
                }

                return ans;
        };

        cout << solve(x) * solve(y) % MOD;
}




signed main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int _t = 1;
//        cin >> _t;
        while (_t--) _main();
        return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define vll vector<ll>

using namespace std;

const ll N = 4e5+100;
const ll MOD = 1e9+7;
string s,t;
ll tree[N];

void build(ll node,ll l,ll r)
{
	if(l==r)
	{
		tree[node] = (s[l-1] == t[r-1]);
	}
	else
	{
		ll mid = (l + r) >> 1LL;
		build(node*2,l,mid);
		build(2*node+1,mid+1,r);
		tree[node] = tree[node*2] + tree[node*2+1];
	}
}

ll query(ll node,ll st,ll en,ll l,ll r)
{
	if(r < st || l> en) return 0;
	if(st >= l && en <= r) return tree[node];
	ll mid = (st + en)/2;
	ll p1 = query(node*2,st,mid,l,r);
	ll p2 = query(node*2+1,mid+1,en,l,r);
	return p1 + p2;
}

ll pre[N];
ll pr2[N];
int main()
{
	ll n,m;
	cin >> n >>m;
	ll a[n+1],b[m+1];

	for(int i =1;i<=n;i++) cin >>a[i-1];
	for(int i =1;i<=m;i++) cin >> b[i-1];

	ll co = 0,co2 = 0;

	for(int i =0;i<(n-1);i++)
	{
		ll x = i+1;
		co = co + ((a[i+1]- a[i]) * (x) * (n-x));
		if(co < MOD) co+=MOD;
		co%=MOD;
	}

	for(int i =0;i<(m-1);i++)
	{
		ll x = i+1;
		co2 = co2 + ((b[i+1]- b[i]) * (x) * (m-x));
		if(co2 < MOD) co2+=MOD;
		co2%=MOD;
	} 
	 		
	 cout << (co*co2) %MOD << endl;
	
	return 0;
}