#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> using lim = numeric_limits<T>;
template <typename T> istream& operator>>(istream& is, vector<T>& a) { for(T& x : a) { is >> x; } return is; }
const int M = 1'000'000'007;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<ll> x(n), y(m);
    cin >> x >> y;
    adjacent_difference(x.begin(), x.end(), x.begin());
    adjacent_difference(y.begin(), y.end(), y.begin());
    ll ysum = 0;
    for(int j = 1; j < m; j++) {
        ysum += y[j] * (m - j) % M * j % M;
        ysum %= M;
    }
    ll xsum = 0;
    for(int i = 1; i < n; i++) {
        xsum += x[i] * (n - i) % M * i % M;
        xsum %= M;
    }
    cout << xsum * ysum % M << endl;
    return 0;
}

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

# define REP(i,n) for (int i=0;i<(n);++i)
# define rep(i,a,b) for(int i=a;i<(b);++i)
# define p(s) std::cout << s ;
# define pl(s)  std::cout << s << endl;
# define printIf(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
# define yes(j) std::cout << (j ? "yes" : "no") << endl;
# define all(v) v.begin(),v.end()
# define showVector(v) REP(i,v.size()){p(v[i]);p(" ")} pl("")
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
typedef long long int ll;
typedef pair<ll,ll> P_ii;
typedef pair<double,double> P_dd;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}

template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}


const int MOD = 1000000007;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;

void addM(long long &a, long long b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void mulM(long long &a, long long b) {
    a = ((a%MOD)*(b%MOD))%MOD ;
}

int main() {
    ll n, m;
    cin >> n >> m;

    vector<ll> x(n),y(m);
    ll xsum = 0, ysum = 0;

    REP(i, n) cin >> x[i];
    sort(all(x));
    REP(i, n - 1) addM(xsum, (x[i+1] - x[i])*(i + 1)*(n - i - 1));
       

    REP(i, m) cin >> y[i];
    sort(all(y));
    REP(i, m - 1) addM(ysum, (y[i+1] - y[i])*(i + 1)*(m - i - 1));

    mulM(xsum,ysum);    

    cout << xsum << endl;

    return 0;
}
