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

using namespace std;

int n, m;

const long long MOD = 1000000007;

long long C(long long a) {
    return a * (a - 1) / 2;
}

int main() {
   cin >> n >> m;
  
        long long ansn = 0;
        long long resn = 0; cin >> resn;
        for (int i = 0; i < n-1; ++i) {
            long long tmp = C(n) - C(i+1) - C(n-1-i);
            long long x; cin >> x;
            ansn += (x - resn) * tmp % MOD;
            ansn %= MOD;
            resn = x;
        }
        long long ansm = 0;
      
        long long resm = 0; cin >> resm;
      
        for (int i = 0; i < m-1; ++i) {
          
            long long tmp = C(m) - C(i+1) - C(m-1-i);
            long long y; cin >> y;
            ansm += (y - resm) * tmp % MOD;
            ansm %= MOD;
            resm = y;
        }
        cout << (ansn * ansm) % MOD << endl;
    }
}


