#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<iomanip>
#include <math.h>
using namespace std;
int main(){
    long long int n,m,x=0,y=0;
    cin>>n>>m;
    vector<long long int>a(1000000);
    vector<long long int>b(1000000);
    for(long long int i=0;i<n;i++){
        cin>>a[i];
        x+=((2*i-n+1)*a[i]);
    }
    for(long long int i=0;i<m;i++){
        cin>>b[i];
        y+=((2*i-m+1)*b[i]);
    }
    x%=1000000007;
    y%=1000000007;
    cout<<(x*y)%1000000007<<endl;
    return 0;
}
