#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int readnum(){
    int n;
    cin >> n;
    return n;
}

vector<int> readarray(int n){
    vector<int> array;
    for(int i = 0; i < n; ++i){
        array.push_back(readnum());
    }
    return array;
}

template <class T, class F>
void foreach_combination(const T& begin, const T& end, F f){
    for(T i = begin; i != end; ++i){
        T j = i; ++j;
        for(; j != end; ++j){
            f(*i,*j);
        }
    }
}

constexpr int divider = 1'000'000'007;

int main(){
    const int n = readnum();
    const int m = readnum();
    const auto xs = readarray(n);
    const auto ys = readarray(m);
    int sum = 0;
    foreach_combination(begin(xs), end(xs), [&](int x1, int x2){
        foreach_combination(begin(ys), end(ys), [&](int y1, int y2){
            const long long w = abs(x2 - x1);
            const long long h = abs(y2 - y1);
            sum += int(w * h % divider);
            sum %= divider;
        });
    });
    cout << sum << endl;
}
