#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int x[100005], y[100005];
int n, m;
long long ax, ay, ans;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 1; i <= m; i++) cin >> y[i];
  for (int i = 1; i <= n; i++) {
    int t = i;
    for (int j = t + 1; j <= n; j++) ax += (x[j] - x[i]) % mod, ax %= mod;
  }
  for (int i = 1; i <= m; i++) {
    int t = i;
    for (int j = t + 1; j <= m; j++) ay += (y[j] - y[i]) % mod, ay %= mod;
  }
  ans = (long long)ax * (long long)ay % mod;
  cout << ans;
}
