#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define For(i, a, b) for (int i = int(a); i < int(b); i++)
#define Dor(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define Foz(i, a) For(i, 0, a)
#define Doz(i, a) Dor(i, 0, a)
#define Trav(e, v) for (auto& e : v)
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<ii>;
template <typename T> bool ckmin (T& a, T b) { return (b < a) ? a = b, 1 : 0; }
template <typename T> bool ckmax (T& a, T b) { return (b > a) ? a = b, 1 : 0; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#ifdef XVENOM
	#define errp(...) fprintf(stderr, __VA_ARGS__)
	#define dbg(...) errp("[%s]: ", #__VA_ARGS__), dbg_str(__VA_ARGS__)
#else
	#define errp(...)
	#define dbg(...)
#endif
template <typename U, typename V> string to_string (pair<U, V>);
string to_string (string& e) { return "\"" + e + "\""; }
string to_string (char e) { return "\'" + string(1, e) + "\'"; }
string to_string (bool e) { return e ? "true" : "false"; }
template <typename T> string to_string (T e) {
	string s = "[ ";
	for (auto& x : e) s += to_string(x) + " ";
	return s + "]";
}
template <typename U, typename V> string to_string (pair<U, V> e) {
	return "(" + to_string(e.first) + ", " + to_string(e.second) + ")";
}
void dbg_str () { errp(" \n"); }
template <typename U, typename... V> void dbg_str (U u, V... v) {
 	errp(" %s", to_string(u).c_str()); dbg_str(v...);
}
/* --- */
const ll Mod = 1000000007;
/* --- */
using MT = decay<decltype(Mod)>::type;

MT inverse (MT a, MT n) {
	MT u = 0, v = 1;
	while (a != 0) {
		MT q = n / a;
		swap(u, v); v -= q * u;
		swap(n, a); a -= q * n;
	}
	assert(n == 1);
	return u;
}

class mint {
private: MT x;
public:
	void normalize() {
		if (x >= Mod || x < 0) x = (x % Mod) + Mod;
		if (x > Mod) x -= Mod;
	}
	mint(): x(0) {}
	mint(MT z): x(z) { normalize(); }
	const MT& operator() () const { return x; }

	mint operator+ (const mint& z) { MT r = x + z(); if (r > Mod) r -= Mod; return mint(r); }
	mint operator- (const mint& z) { MT r = x - z(); if (r < 0) r += Mod; return mint(r); }
	mint operator* (const mint& z) { MT r = x * z(); if (r > Mod) r %= Mod; return mint(r); }
	mint operator/ (const mint& z) { return (*this) * mint(inverse(z(), Mod)); }

	mint operator+= (const mint& z) { (*this) = (*this) + z; return (*this); }
	mint operator-= (const mint& z) { (*this) = (*this) - z; return (*this); }
	mint operator*= (const mint& z) { (*this) = (*this) * z; return (*this); }
	mint operator/= (const mint& z) { (*this) = (*this) / z; return (*this); }

	friend std::istream& operator>> (std::istream&, mint&);
};

std::istream& operator>> (std::istream& stream, mint& p) {
	MT v; stream >> v; p.x = v; p.normalize(); return stream;
}
std::ostream& operator<< (std::ostream& stream, const mint& p) { return stream << p(); }
mint operator+ (const MT& p, const mint& q) { return mint(p) + q; }
mint operator- (const MT& p, const mint& q) { return mint(p) - q; }
mint operator* (const MT& p, const mint& q) { return mint(p) * q; }
mint operator/ (const MT& p, const mint& q) { return mint(p) / q; }
string to_string (const mint& p) { return to_string(p()); }

mint powMod (mint a, MT b) {
	mint res = 1, x = a;
	while (b > 0) {
		if (b & 1) res *= x;
		x *= x;
		b >>= 1;
	}
	return res;
}
/* --- */
const int N = 100010;
ll x[N], y[N], n, m;

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	/* --- */
	cin >> n >> m;
	Foz(i, n) cin >> x[i];
	Foz(i, m) cin >> y[i];

	mint a = 0, b = 0;
	Foz(i, n) a += x[i] * i;
	Foz(i, n) a -= x[i] * (n - i - 1);
	
	Foz(i, m) b += y[i] * i;
	Foz(i, m) b -= y[i] * (m - i - 1);

	mint ans = a * b;
	cout << ans() << '\n';
}



Measured memory_bytes: 1792