#include <iostream>
using namespace std;

const long long MOD = 1000000007;

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

	long long sum_x = 0;
	for (int i = 1; i <= n; i++) {
		long long x;
		cin >> x;
		sum_x = (sum_x + (2*i-n-1)*x) % MOD;
	}

	long long sum_y = 0;
	for (int i = 1; i <= m; i++) {
		long long y;
		cin >> y;
		sum_y = (sum_y + (2*i-m-1)*y) % MOD;
	}
	
	cout << (sum_x * sum_y) % MOD << endl;
}
