//20190116 20:10
#include <iostream>
#include <vector>

using namespace std;

void vec_cin(vector<int> &vec){
    for(int i=0; i<vec.size(); i++){
        cin >> vec[i];
    }
}

int main(){
    long long MOD = 1000000007;
    int n,m;
    cin >> n >> m;

    vector<int> x(n);
    vector<int> y(m);
    long long H=0;
    long long W=0;

    vec_cin(x);
    vec_cin(y);

    for(int i=0; i<m-1; i++){
        H+=(long long) (y[i+1]-y[i])*(i+1)*(m-i-1);
        H%=MOD;
    }
    for(int i=0; i<n-1; i++){
        W+=(long long) (x[i+1]-x[i])*(i+1)*(n-i-1);
        W%=MOD;
    }
    cout << (H*W)%MOD << endl;

}