#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;

namespace mymod {
    constexpr ll modulus = 1000000007LL;

    ll add(ll a, ll b);

    ll sub(ll a, ll b);

    ll mul(ll a, ll b);

    ll power(ll a, ll b);

    ll div(ll a, ll b);
}

ll mymod::add(ll a, ll b){return (a + b) % modulus;}
ll mymod::sub(ll a, ll b){return (a + modulus - b) % modulus;}
ll mymod::mul(ll a, ll b){return ((a % modulus) * (b % modulus)) % modulus;}
ll mymod::power(ll a, ll b){
    if (b == 0) return 1;
    else if (b == 1) return a % modulus;
    else if (b % 2 == 0){ll p = power(a, b / 2); return p * p % modulus;}
    else return a * power(a, b-1) % modulus;
}
ll mymod::div(ll a, ll b){return mul(a, power(b, modulus-2));}

ll hoge(vector<ll> ls){
    ll k{ls.size()};
    vector<ll> d(k-1, k-2);
    for (auto &&i: boost::irange(0LL, k-2)){
        d.at(i+1) = d.at(i) - 2;
    }
    vector<ll> r(k, k);
    for (auto &&i: boost::irange(0LL, k-1)){
        r.at(i+1) = mymod::add(r.at(i), d.at(i));
    }
    for (auto &&i: boost::irange(0LL, k)){
        ls.at(i) = mymod::mul(ls.at(i), r.at(i));
    }
    ll ret{0};
    for (auto &&i: boost::irange(0LL, k)){
        ret = mymod::add(ret, ls.at(i));
    }
    return ret;
}

int main() {
    ll n, m;
    cin >> n >> m;
    vector<ll> xs(n, 0), ys(m, 0);
    for (auto && i: boost::irange(0LL, n)){
        cin >> xs.at(i);
    }
    for (auto && i: boost::irange(0LL, m)){
        cin >> ys.at(i);
    }
    vector<ll> d_xs(n-1, 0), d_ys(m-1, 0);
    for (auto &&i: boost::irange(0LL, n-1)){
        d_xs.at(i) = xs.at(i+1) - xs.at(i);
    }
    for (auto &&i: boost::irange(0LL, m-1)){
        d_ys.at(i) = ys.at(i+1) - ys.at(i);
    }

    cout << mymod::mul(hoge(d_xs), hoge(d_ys));
    return 0;
}