// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }

template<int MOD> struct modint {
    long long val;

    constexpr modint(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) v += MOD;
    }
    constexpr modint operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    
    constexpr int getmod() { return MOD; }
    constexpr modint operator + (const modint& r) const noexcept { return modint(*this) += r; }
    constexpr modint operator - (const modint& r) const noexcept { return modint(*this) -= r; }
    constexpr modint operator * (const modint& r) const noexcept { return modint(*this) *= r; }
    constexpr modint operator / (const modint& r) const noexcept { return modint(*this) /= r; }
    constexpr modint& operator += (const modint& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr modint& operator -= (const modint& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr modint& operator *= (const modint& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr modint& operator /= (const modint& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const modint& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const modint& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const modint<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr istream& operator >> (istream &is, modint<MOD>& x) noexcept {
        return is >> x.val;
    }
    friend constexpr modint<MOD> modpow(const modint<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
using mint = modint<MOD>;
typedef vector<mint> mvec;
typedef vector<vector<mint>> mvvec;

typedef complex<double> C;
int fft_n;
vector<C> omega;

int mod_pow(int x, int y = MOD - 2) {
  int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % MOD;
    x = (x * x) % MOD;
    y >>= 1;
  }
  return res;
}

void init_fft(int n) {
  fft_n = n;
  omega.resize(n);
  double angle = 2 * M_PI / n;
  REP(i,n) {
    omega[i] = C(cos(i * angle), sin(i * angle));
  }
}

void fft(vector<C> & a) {
  int n = a.size();
  if (n == 1) return;
  int half = n >> 1;
  vector<C> even(half), odd(half);
  for (int i = 0, j = 0; i < n; i += 2, ++j) {
    even[j] = a[i];
    odd[j] = a[i+1];
  }
  fft(even); fft(odd);
  for (int i = 0, fact = fft_n / n; i < half; ++i) {
    C twiddle = odd[i] * omega[i * fact];
    a[i] = even[i] + twiddle;
    a[i + half] = even[i] - twiddle;
  }
}

vector<int> mul_fft(const vector<int> &a, const vector<int> &b) {
  vector<int> res;
  vector<C> fa(a.begin(), a.end()), fb(b.begin(), b.end());
  int n = 1;
  while (n < 2 * max (a.size(), b.size())) n <<= 1;
  fa.resize(n); fb.resize(n);
  init_fft(n);
  fft(fa); fft(fb);
  REP(i,n) fa[i] = conj(fa[i] * fb[i]);
  fft(fa);
  res.resize (n);
  REP(i,n) {
    res[i] = (int) (fa[i].real() / n + 0.5);
  }
  return res;
}
// vec hoge = mul_fft(a,b)で呼び出し
// hoge[i]はΣa[k]*b[i-k]
// a,bは1-indexedで取る(0があれば0に)

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------

    int n,m;
    cin>>n>>m;
    vec x(n);
    vec y(m);
    REP(i,n) cin >> x[i];
    REP(i,m) cin >> y[i];

    vec dx(n);
    vec dy(m);
    for(int i=1;i<n;i++){
        dx[i]=( (x[i]-x[i-1]) % MOD ) * i * (n-i) % MOD;
        // debug(dx[i]);
    }
    for(int i=1;i<m;i++){
        dy[i]=( (y[i]-y[i-1]) % MOD ) * i * (m-i) % MOD;
        // debug(dy[i]);
    }

    vec fftt=mul_fft(dx,dy);
    mint ans=0;
    for(int i=0;i<n+m-1;i++){
        ans+=fftt[i];
        // debug(fftt[i]);
    }
    cout<<ans<<endl;

}