#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <unordered_map> //C++11
using namespace std;

typedef long long ll;

int main() {
	int n, m;
	ll sum = 0, ans = 0;
	cin >> n >> m;
	ll work;
	for (int i = 1; i <= n; i++) {
		cin >> work;
		ans += work*(i - 1) - work*(n - i);
		ans %= 1000000007;
	}
	for (int i = 1; i <= m; i++) {
		cin >> work;
		sum += work*(i - 1) - work*(m - i);
		sum %= 1000000007;
	}
	ans *= sum;
	ans %= 1000000007;
	cout << ans << endl;
	return 0;
}

